Problem E
Pop Count

Ivan has been woken up yet again by the fire alarm at 3 in the morning (probably due to some moron trying to make popcorn; Ivan himself has most certainly never, ever done this, and any memories you might have of him doing this last Thursday are almost certainly faulty). Since he is now awake and probably won’t be able to go back to sleep, he decides he might as well make some popcorn, and passes the time making graphs of his microwave’s kernel-popping efficiency. In order to do this, he needs to count the number of popped kernels at a given instant in time, but doing this by hand is tedious. That’s where you come in!
Input
The input consists of a single line with a string describing the kernels. Each character in the string is either 0 for an unpopped kernel, or 1 for a popped kernel. There will be at least $1$ and at most $100$ kernels.
Output
Output a single integer, the number of popped kernels.
Sample Input 1 | Sample Output 1 |
---|---|
101101110 |
6 |
Sample Input 2 | Sample Output 2 |
---|---|
000 |
0 |