e-olymp
Competitions

December 2 - BMTK Programming School, Small League

Number of maximal digits

Find out how many times the maximum digit appears in positive integer n.

Input

One positive integer n (n < 1018).

Output

Print how many times the maximum digit appears in positive integer n.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2354
Output example #1
1
Input example #2
606432232464626
Output example #2
5