#include <iostream>
using namespace std;
int cmmdc(int a, int b)
{
int r = a % b;
while (r != 0)
{
a = b;
b = r;
r = a % b;
}
return b;
}
int main()
{
int n, a, num = 0;
cin >> n >> a;
int v[n];
for (int i = 1; i <= n; i++)
{
cin >> v[i];
if (cmmdc(v[i], a) == 1)
{
num++;
}
}
cout << num;
return 0;
}