#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 table[42] = {}, n, ans = 0;
  scanf("%d", &n);
  table[n % 42] = 1;
  scanf("%d", &n);
  table[n % 42] = 1;
  scanf("%d", &n);
  table[n % 42] = 1;
  scanf("%d", &n);
  table[n % 42] = 1;
  scanf("%d", &n);
  table[n % 42] = 1;
  scanf("%d", &n);
  table[n % 42] = 1;
  scanf("%d", &n);
  table[n % 42] = 1;
  scanf("%d", &n);
  table[n % 42] = 1;
  scanf("%d", &n);
  table[n % 42] = 1;
  scanf("%d", &n);
  table[n % 42] = 1;
  for (n = 0; n < 42; n++) {
    ans += table[n];
  }
  printf("%d", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0xa8,%edx
call   1040 <memset@plt>
movl   $0x0,-0xb8(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
lea    0xe6b(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
lea    0xe3c(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
lea    0xe0d(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
lea    0xdde(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
lea    0xdaf(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
lea    0xd80(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
lea    0xd51(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
lea    0xd22(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
lea    0xcf3(%rip),%rdi
lea    -0xb4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xb4(%rbp),%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
movl   $0x1,-0xb0(%rbp,%rax,4)
movl   $0x0,-0xb4(%rbp)
cmpl   $0x2a,-0xb4(%rbp)
jge    137a <main+0x24a>
movslq -0xb4(%rbp),%rax
mov    -0xb0(%rbp,%rax,4),%eax
add    -0xb8(%rbp),%eax
mov    %eax,-0xb8(%rbp)
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    133f <main+0x20f>
mov    -0xb8(%rbp),%esi
lea    0xc79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xb8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0xb0(%rsp)
lea    0xe85(%rip),%r14
lea    0xc(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x30c30c31,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %edx,%ecx
imul   $0x2a,%ecx,%ecx
sub    %ecx,%eax
cltq
movl   $0x1,0x10(%rsp,%rax,4)
movdqu 0x88(%rsp),%xmm0
movdqu 0xa8(%rsp),%xmm1
movdqu 0x68(%rsp),%xmm2
paddd  %xmm1,%xmm2
movdqu 0x78(%rsp),%xmm1
movdqu 0x18(%rsp),%xmm3
movdqu 0x28(%rsp),%xmm4
paddd  %xmm3,%xmm4
movdqu 0x38(%rsp),%xmm3
paddd  %xmm1,%xmm3
movdqu 0x48(%rsp),%xmm1
paddd  %xmm0,%xmm1
paddd  %xmm2,%xmm1
movdqu 0x98(%rsp),%xmm0
movdqu 0x58(%rsp),%xmm2
paddd  %xmm0,%xmm2
paddd  %xmm3,%xmm2
paddd  %xmm1,%xmm2
pshufd $0xee,%xmm2,%xmm0
paddd  %xmm2,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
pshufd $0xee,%xmm4,%xmm0
paddd  %xmm4,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%esi
add    %eax,%esi
add    0x14(%rsp),%esi
add    0x10(%rsp),%esi
movl   $0x2a,0xc(%rsp)
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [42 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [42 x i32]* %2 to i8*
store i32 0, i32* %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = srem i32 %7, 42
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %9
store i32 1, i32* %10
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = srem i32 %12, 42
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %14
store i32 1, i32* %15
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
%18 = srem i32 %17, 42
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %19
store i32 1, i32* %20
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%22 = load i32, i32* %3
%23 = srem i32 %22, 42
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %24
store i32 1, i32* %25
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%27 = load i32, i32* %3
%28 = srem i32 %27, 42
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %29
store i32 1, i32* %30
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%32 = load i32, i32* %3
%33 = srem i32 %32, 42
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %34
store i32 1, i32* %35
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%37 = load i32, i32* %3
%38 = srem i32 %37, 42
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %39
store i32 1, i32* %40
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%42 = load i32, i32* %3
%43 = srem i32 %42, 42
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %44
store i32 1, i32* %45
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%47 = load i32, i32* %3
%48 = srem i32 %47, 42
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %49
store i32 1, i32* %50
%51 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%52 = load i32, i32* %3
%53 = srem i32 %52, 42
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %54
store i32 1, i32* %55
store i32 0, i32* %3
br label %56
56: ; preds = %66, %0
%57 = load i32, i32* %3
%58 = icmp slt i32 %57, 42
br i1 %58, label %59, label %69
59: ; preds = %56
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [42 x i32], [42 x i32]* %2, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = load i32, i32* %4
%65 = add nsw i32 %64, %63
store i32 %65, i32* %4
br label %66
66: ; preds = %59
%67 = load i32, i32* %3
%68 = add nsw i32 %67, 1
store i32 %68, i32* %3
br label %56
69: ; preds = %56
%70 = load i32, i32* %4
%71 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %70)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [42 x i32]
%2 = alloca i32
%3 = bitcast [42 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = srem i32 %6, 42
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %8
store i32 1, i32* %9
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = srem i32 %11, 42
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %13
store i32 1, i32* %14
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = srem i32 %16, 42
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %18
store i32 1, i32* %19
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %2
%22 = srem i32 %21, 42
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %23
store i32 1, i32* %24
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%26 = load i32, i32* %2
%27 = srem i32 %26, 42
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %28
store i32 1, i32* %29
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%31 = load i32, i32* %2
%32 = srem i32 %31, 42
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %33
store i32 1, i32* %34
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%36 = load i32, i32* %2
%37 = srem i32 %36, 42
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %38
store i32 1, i32* %39
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%41 = load i32, i32* %2
%42 = srem i32 %41, 42
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %43
store i32 1, i32* %44
%45 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%46 = load i32, i32* %2
%47 = srem i32 %46, 42
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %48
store i32 1, i32* %49
%50 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%51 = load i32, i32* %2
%52 = srem i32 %51, 42
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 %53
store i32 1, i32* %54
%55 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 0
%56 = load i32, i32* %55
%57 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 1
%58 = load i32, i32* %57
%59 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 2
%60 = bitcast i32* %59 to <8 x i32>*
%61 = load <8 x i32>, <8 x i32>* %60
%62 = getelementptr inbounds [42 x i32], [42 x i32]* %1, i64 0, i64 10
%63 = bitcast i32* %62 to <32 x i32>*
%64 = load <32 x i32>, <32 x i32>* %63
%65 = call i32 @llvm.vector.reduce.add.v32i32(<32 x i32> %64)
%66 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %61)
%67 = add nsw i32 %65, %66
%68 = add nsw i32 %67, %58
%69 = add nsw i32 %68, %56
store i32 42, i32* %2
%70 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %69)
ret i32 0
}