#K36422. Count Completed Tasks
Count Completed Tasks
Count Completed Tasks
Given an 8-character binary string (S) (each character is either '0' or '1'), count the number of completed tasks. A task is considered completed if the corresponding character is '1'.
You are required to read the input from standard input and output the result to standard output. The input string is guaranteed to be exactly 8 characters long.
For example, if the input is ( "10101010" ), then the correct output is (4) because there are four '1's in the string.
inputFormat
A single line containing an 8-character string composed exclusively of '0's and '1's.
outputFormat
An integer representing the number of '1's in the input string.## sample
11111111
8