#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 *, int);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int lines_n, divider, current, i, counter = 0;
  scanf("%d%d", &lines_n, &divider);
  for (i = 0; i < lines_n; ++i) {
    scanf("%d", &current);
    if (!(current % divider))
      ++counter;
  }
  printf("%d\n", counter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    119d <main+0x7d>
lea    0xe9c(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    118a <main+0x6a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    118f <main+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <main+0x33>
mov    -0x18(%rbp),%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xecf(%rip),%rdi
xor    %ebx,%ebx
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1185 <main+0x65>
lea    0xeb0(%rip),%r14
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
cltd
idivl  0x14(%rsp)
cmp    $0x1,%edx
adc    $0x0,%ebx
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     1160 <main+0x40>
lea    0xe79(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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