Given a sequence of characters, at the beginning of which there is a certain number of identical characters. Determine this quantity.
Solve the problem
without using the built-in string functions, except for a function that returns the length of a string.
Input: The first line is a sequence of characters.
Output: should print the number of identical characters at the beginning of the string.
Sample input and output
Test number |
Input |
Output |
1 |
foresete |
0 |
2 |
aaav |
3 |