A sequence of length is given. We want to remove the minimum number of elements from such that when the remaining elements are treated as strings and concatenated in order, the resulting string does not contain 67 as a substring.
Definition of Substring
A substring of a string refers to a string that can be made by erasing some(possibly, zero) elements from the beginning, and some(possibly, zero) elements from the end of . For example, substrings of abcdab include bcd, abcdab, b, da, and so on. Meanwhile acd, aa, etc., are not substring of abcdab.
For example, if we remove the elements and from , the sequence becomes , and the string formed by concatenating them contains as a substring, which does not satisfy the condition.
Find the minimum number of elements to remove so that the remaining sequence satisfies the given condition.
Input
The input is given in the following format.
Output
Print the minimum number of elements to remove.
Constraints
- .