Let us call a number interesting if it is divisible by P and each of its digit is equal to some digit of the interesting set. You are given the interesting set and the number P, you need to calculate the count of interesting numbers between two given values L and R (inclusive).
Input:
First line of input contains 4 space separated integers P, L, R and Z. Here P, L and R are as defined in the problem statement, and Z is the size of the interesting set. Next line contains Z space separated integers, where the ith integer Fi represents the ith number of the interesting set.
Output:
Print the count of interesting numbers in the range L to R inclusive.
Constraints:
1≤L≤R≤1018
1≤P≤105
1≤Z≤10
0≤Fi≤9
The three interesting numbers are 4,8 and 10.