#P1575D. Divisible by Twenty-Five

    ID: 384 Type: RemoteJudge 2000ms 512MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>brute forcedfs and similardp*1800

Divisible by Twenty-Five

No submission language available for this problem.

Description

Mr. Chanek has an integer represented by a string ss. Zero or more digits have been erased and are denoted by the character _. There are also zero or more digits marked by the character X, meaning they're the same digit.

Mr. Chanek wants to count the number of possible integer ss, where ss is divisible by 2525. Of course, ss must not contain any leading zero. He can replace the character _ with any digit. He can also replace the character X with any digit, but it must be the same for every character X.

As a note, a leading zero is any 0 digit that comes before the first nonzero digit in a number string in positional notation. For example, 0025 has two leading zeroes. An exception is the integer zero, (0 has no leading zero, but 0000 has three leading zeroes).

One line containing the string ss (1s81 \leq |s| \leq 8). The string ss consists of the characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, _, and X.

Output an integer denoting the number of possible integer ss.

Input

One line containing the string ss (1s81 \leq |s| \leq 8). The string ss consists of the characters 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, _, and X.

Output

Output an integer denoting the number of possible integer ss.

Samples

Sample Input 1

25

Sample Output 1

1

Sample Input 2

_00

Sample Output 2

9

Sample Input 3

_XX

Sample Output 3

9

Sample Input 4

0

Sample Output 4

1

Sample Input 5

0_25

Sample Output 5

0

Note

In the first example, the only possible ss is 2525.

In the second and third example, s{100,200,300,400,500,600,700,800,900}s \in \{100, 200,300,400,500,600,700,800,900\}.

In the fifth example, all possible ss will have at least one leading zero.