#6Easy
Until zero
Time: 1 s · Memory: 256 MB
- Input and output
Statement
You are given a sequence of integers that ends with the number . Find how many numbers were entered before (the itself is not counted).
Input format
Each line contains one integer. The last number is ; the numbers before it are non-zero and . There are from to numbers before the .
Output format
A single integer — how many numbers were entered before .
Examples
Input
5 -3 8 0
Output
3
Input
0
Output
0
Note
The count is not given in advance, so instead of for you need a while loop that keeps reading until it meets . In the second example the very first number is , so the answer is .
