#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 getN();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = getN();
  int k = getN();
  int res = 0;
  int i;
  for (i = 0; i < n; i++) {
    if (getN() % k == 0) {
      res++;
    }
  }
  printf("%d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getN@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getN@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    118d <main+0x6d>
mov    $0x0,%al
call   1030 <getN@plt>
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    117a <main+0x5a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117f <main+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <main+0x31>
mov    -0x10(%rbp),%esi
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getN@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getN@plt>
test   %ebp,%ebp
jle    1156 <main+0x36>
mov    %eax,%r14d
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1030 <getN@plt>
cltd
idiv   %r14d
cmp    $0x1,%edx
adc    $0x0,%ebx
add    $0xffffffff,%ebp
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getN()
%2 = tail call i32 (...) @getN()
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %0, %4
%5 = phi i32 [ %12, %4 ], [ 0, %0 ]
%6 = phi i32 [ %11, %4 ], [ 0, %0 ]
%7 = tail call i32 (...) @getN()
%8 = srem i32 %7, %2
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %4
14: ; preds = %4, %0
%15 = phi i32 [ 0, %0 ], [ %11, %4 ]
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}