A substring is a string formed by choosing contiguous characters from a string. A substhreeng is a substring that meets two more requirements:
For example, the string 130a303 contains 9 substhreengs: 3 three times, 30 and 0 twice each, and 303 and 03 once each. The substring 30a3 is not a substhreeng because it contains a character that is not a digit, and the substring 13 is not a substhreeng because 13 is not a multiple of 3.
Two substhreengs count as different when they have different lengths or start at different positions, even if the chosen characters are the same.
Given a string S, count the substhreengs it contains.
The first line contains a string S. S is non-empty and has at most 106 characters. Each character of S is a digit or a lowercase English letter.
Print the number of substhreengs contained in S on one line.