#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);
int /*<<< orphan*/ scanf(char *, long *, ...);
int main(int argc, char const *argv[]) {
  long n, k;
  long input;
  long output = 0;
  scanf("%ld %ld", &n, &k);
  while (n) {
    n--;
    scanf("%ld", &input);
    if (input % k == 0) {
      output++;
    }
  }
  printf("%ld\n", output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x30(%rbp)
lea    0xebb(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
cmpq   $0x0,-0x18(%rbp)
je     11a2 <main+0x82>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
lea    0xe92(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x28(%rbp),%rax
cqto
idivq  -0x20(%rbp)
cmp    $0x0,%rdx
jne    119d <main+0x7d>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1154 <main+0x34>
mov    -0x30(%rbp),%rsi
lea    0xe5b(%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>
mov    0x8(%rsp),%rax
test   %rax,%rax
je     11a9 <main+0x89>
lea    0xeb0(%rip),%r14
lea    0x10(%rsp),%r15
jmp    1177 <main+0x57>
nopl   0x0(%rax,%rax,1)
cqto
idiv   %rcx
cmp    $0x1,%rdx
adc    $0x0,%rbx
mov    0x8(%rsp),%rax
test   %rax,%rax
je     11a9 <main+0x89>
add    $0xffffffffffffffff,%rax
mov    %rax,0x8(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%rax
mov    0x18(%rsp),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1160 <main+0x40>
xor    %edx,%edx
div    %ecx
jmp    1165 <main+0x45>
lea    0xe58(%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 = [8 x i8] c"%ld %ld\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %9
%10 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %6, i64* %7)
br label %11
11: ; preds = %25, %2
%12 = load i64, i64* %6
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = load i64, i64* %6
%16 = add nsw i64 %15, -1
store i64 %16, i64* %6
%17 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %8)
%18 = load i64, i64* %8
%19 = load i64, i64* %7
%20 = srem i64 %18, %19
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %14
%23 = load i64, i64* %9
%24 = add nsw i64 %23, 1
store i64 %24, i64* %9
br label %25
25: ; preds = %22, %14
br label %11
26: ; preds = %11
%27 = load i64, i64* %9
%28 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 %27)
ret i32 0
}

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