This page is still under construction.

Parts of this page are still being built. What you see may change.

Comma Integer Count

Time limit1sMemory limit256 MB

Summary
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 SS made only of digits and commas is given. Count the integers in SS.

An integer is a run of one or more consecutive digits in SS. 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 SS. 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 SS on one line.

Examples3

  1. Example 1

    Input
    10,20,30,50,100
    
    Expected output
    5
    
  2. Example 2

    Input
    1
    
    Expected output
    1
    
  3. Example 3

    Input
    1,2,3
    
    Expected output
    3