#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
scalar_t__ scanf(char *, long *, ...);
int main(void) {
  long n, k, t, count = 0;
  scanf("%ld%ld", &n, &k);
  for (; n > 0 && scanf("%ld", &t); n--) {
    if (t % k == 0) {
      count++;
    }
  }
  printf("%ld", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x28(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x29(%rbp)
jle    1179 <main+0x59>
lea    0xe9f(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    1189 <main+0x69>
jmp    11bf <main+0x9f>
mov    -0x20(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
jne    11a9 <main+0x89>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11ae <main+0x8e>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    114d <main+0x2d>
mov    -0x28(%rbp),%rsi
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xed0(%rip),%rdi
xor    %ebx,%ebx
lea    0x8(%rsp),%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmpq   $0x0,0x8(%rsp)
jle    11af <main+0x8f>
lea    0xeb1(%rip),%r14
lea    0x10(%rsp),%r15
jmp    1180 <main+0x60>
nopl   0x0(%rax)
xor    %edx,%edx
div    %ecx
cmp    $0x1,%rdx
adc    $0x0,%rbx
mov    0x8(%rsp),%rax
lea    -0x1(%rax),%rcx
mov    %rcx,0x8(%rsp)
cmp    $0x1,%rax
jle    11af <main+0x8f>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
test   %rax,%rax
je     11af <main+0x8f>
mov    0x10(%rsp),%rax
mov    0x18(%rsp),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1160 <main+0x40>
cqto
idiv   %rcx
jmp    1164 <main+0x44>
lea    0xe4d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%ld%ld\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %5
%6 = call i64 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
br label %7
7: ; preds = %24, %0
%8 = load i64, i64* %2
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = call i64 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %4)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %27
15: ; preds = %13
%16 = load i64, i64* %4
%17 = load i64, i64* %3
%18 = srem i64 %16, %17
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i64, i64* %5
%22 = add nsw i64 %21, 1
store i64 %22, i64* %5
br label %23
23: ; preds = %20, %15
br label %24
24: ; preds = %23
%25 = load i64, i64* %2
%26 = add nsw i64 %25, -1
store i64 %26, i64* %2
br label %7
27: ; preds = %13
%28 = load i64, i64* %5
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%ld%ld\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i64 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%8 = load i64, i64* %1
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %0, %14
%11 = phi i64 [ %20, %14 ], [ 0, %0 ]
%12 = call i64 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %3)
%13 = icmp eq i64 %12, 0
br i1 %13, label %24, label %14
14: ; preds = %10
%15 = load i64, i64* %3
%16 = load i64, i64* %2
%17 = srem i64 %15, %16
%18 = icmp eq i64 %17, 0
%19 = zext i1 %18 to i64
%20 = add nuw nsw i64 %11, %19
%21 = load i64, i64* %1
%22 = add nsw i64 %21, -1
store i64 %22, i64* %1
%23 = icmp sgt i64 %21, 1
br i1 %23, label %10, label %24
24: ; preds = %10, %14, %0
%25 = phi i64 [ 0, %0 ], [ %20, %14 ], [ %11, %10 ]
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %25)
ret i32 0
}