import java.util.;
import java.io.;
class InputTest{
public static void main(String args[]) throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String arr[]=br.readLine().split(" ");
int n=Integer.parseInt(arr[0]);
int k=Integer.parseInt(arr[1]);
int count=0;
if(n<=0 || k<=0 || k>Math.pow(10,7)){
throw new Exception();
}
else{
for(int i=0;i<n;i++){
int m=Integer.parseInt(br.readLine());
if(m>Math.pow(10,9))
throw new Exception();
if(m%k==0)
count++;
}
System.out.println(count);
}
}
}