A pattern of size is a string of length , where each character belongs to the set \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, g, ?\}. Patterns are converted into strings of digits according to the following rules:
Characters to can be converted only to themselves.
Symbol can be converted to any of the symbols , , , .
Symbol can be converted to any of the symbols , , , .
Symbol can be converted to any of the symbols , , , .
Symbol can be converted to any of the symbols , , , .
Symbol can be converted to any of the symbols , , , .
Symbol can be converted to any of the symbols , , , .
Symbol can be converted to any of the symbols , , , .
Symbol can be converted to any of the symbols from to .
Given two patterns: p_1 and p_2. Let S_1 be the set of strings that can be obtained from p_1 according to the rules described, and S_2 the set of strings obtained from p_2. Find the number of strings contained in both sets.
The first line contains the pattern p_1, the second line contains the pattern p_2. The patterns have the same positive length, not exceeding .
Print the answer to the problem.
Esempio 1