#abc287b. [abc287_b]Postal Card
[abc287_b]Postal Card
Problem Statement
You are given strings of length six each, consisting of digits. Let be the -th of them.
You are also given strings of length three each, consisting of digits. Let be the -th of them.
Find the number of strings among whose last three characters coincide with one or more of .
Constraints
- and are integers.
- is a string of length consisting of digits, for all .
- is a string of length consisting of digits, for all .
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
Sample Output 1
The last three characters of are 857
, which coincide with .
The last three characters of are 159
, which coincide with .
The last three characters of are 028
, which do not coincide with , , or .
Thus, the answer is .