There are x number of girls and they rolled a dice in turns one after another.
If the number on the dice is 6, then the dice will be rolled again until she get a number other than 6.
Since you know the sequence of numbers which the dice shows when rolled each time, you have to find what is the total number of girls or if the sequence is invalid.
Input format
A single line that contains a string s (1≤|s|≤105) denoting the sequence of numbers the dice rolls on written as string.
Output format
The second person rolls the dice 3 times so the number of people will be 5.