Comma Integer Count
Time limit1sMemory limit256 MB
Count the maximal runs of digits in a comma-separated digit string.
- Level
Easy1 of 10
- Topics
- String
- Solved
- No attempts yet
Problem
A string made only of digits and commas is given. Count the integers in .
An integer is a run of one or more consecutive digits in . A place between two commas that holds no digit is not counted. For the string 1,,23 the integers are 1 and 23, so the answer is 2. For the string ,,, the answer is 0.
Input
The first line contains the string . It is made only of digits and commas, and its length is at least 1 and at most 100.
Output
Print the number of integers in on one line.