Two positive integers are said to be relatively prime if their greatest common divisor is equal to 1. You will be given a string of digits S and an integer M. We call a substring, T, of S special if T and M are relatively prime. Your task is to count the number of special substrings of S.
Notes:
Input:
The first line contains two integers: N (1≤N≤103), the length of the string and an integer M (1≤M≤109). The second line contains a string S of length N. You can safely assume that S contains digits only.
Output:
Print he number of special substrings of S.