#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 number_of_socks;
  int number_of_pairs = 0;
  scanf("%d", &number_of_socks);
  int socks[101] = {0};
  for (int i = 0; i < number_of_socks; i++) {
    int color;
    scanf("%d", &color);
    socks[color] += 1;
  }
  for (int color = 1; color < 101; color++) {
    if (socks[color] == 0)
      continue;
    number_of_pairs += socks[color] / 2;
  }
  printf("%d", number_of_pairs);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x194,%edx
call   1040 <memset@plt>
movl   $0x0,-0x1a4(%rbp)
mov    -0x1a4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c4 <main+0x94>
lea    0xe74(%rip),%rdi
lea    -0x1a8(%rbp),%rsi
call   1050 <scanf@plt>
movslq -0x1a8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1176 <main+0x46>
movl   $0x1,-0x1ac(%rbp)
cmpl   $0x65,-0x1ac(%rbp)
jge    1225 <main+0xf5>
movslq -0x1ac(%rbp),%rax
cmpl   $0x0,-0x1a0(%rbp,%rax,4)
jne    11f5 <main+0xc5>
jmp    1211 <main+0xe1>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    11ce <main+0x9e>
mov    -0xc(%rbp),%esi
lea    0xdd1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x1b0,%rsp
lea    0xebe(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rdi
xor    %ebp,%ebp
mov    $0x194,%edx
xor    %esi,%esi
call   1040 <memset@plt>
cmpl   $0x0,0x8(%rsp)
jle    119e <main+0x6e>
lea    0xe93(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
addl   $0x1,0x10(%rsp,%rax,4)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     1180 <main+0x50>
pxor   %xmm0,%xmm0
mov    $0x5,%eax
pxor   %xmm2,%xmm2
nopl   0x0(%rax,%rax,1)
movdqu (%rsp,%rax,4),%xmm1
movdqa %xmm1,%xmm3
psrld  $0x1f,%xmm3
paddd  %xmm1,%xmm3
psrad  $0x1,%xmm3
pcmpeqd %xmm0,%xmm1
pandn  %xmm3,%xmm1
paddd  %xmm2,%xmm1
cmp    $0x65,%rax
je     1207 <main+0xd7>
movdqu 0x10(%rsp,%rax,4),%xmm2
movdqa %xmm2,%xmm3
psrld  $0x1f,%xmm3
paddd  %xmm2,%xmm3
psrad  $0x1,%xmm3
pcmpeqd %xmm0,%xmm2
pandn  %xmm3,%xmm2
paddd  %xmm2,%xmm1
add    $0x8,%rax
movdqa %xmm1,%xmm2
jmp    11b0 <main+0x80>
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%esi
lea    0xddc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [101 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = bitcast [101 x i32]* %4 to i8*
store i32 0, i32* %5
br label %10
10: ; preds = %21, %0
%11 = load i32, i32* %5
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [101 x i32], [101 x i32]* %4, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %18
br label %21
21: ; preds = %14
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %10
24: ; preds = %10
store i32 1, i32* %7
br label %25
25: ; preds = %43, %24
%26 = load i32, i32* %7
%27 = icmp slt i32 %26, 101
br i1 %27, label %28, label %46
28: ; preds = %25
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [101 x i32], [101 x i32]* %4, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %28
br label %43
35: ; preds = %28
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [101 x i32], [101 x i32]* %4, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = sdiv i32 %39, 2
%41 = load i32, i32* %3
%42 = add nsw i32 %41, %40
store i32 %42, i32* %3
br label %43
43: ; preds = %35, %34
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %25
46: ; preds = %25
%47 = load i32, i32* %3
%48 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %47)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [101 x i32]
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = bitcast [101 x i32]* %2 to i8*
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %47
9: ; preds = %0
%10 = bitcast i32* %3 to i8*
br label %36
11: ; preds = %23, %47
%12 = phi i64 [ 0, %47 ], [ %32, %23 ]
%13 = phi <4 x i32> [ zeroinitializer, %47 ], [ %31, %23 ]
%14 = or i64 %12, 1
%15 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %14
%16 = bitcast i32* %15 to <4 x i32>*
%17 = load <4 x i32>, <4 x i32>* %16
%18 = icmp eq <4 x i32> %17, zeroinitializer
%19 = sdiv <4 x i32> %17, <i32 2, i32 2, i32 2, i32 2>
%20 = select <4 x i1> %18, <4 x i32> zeroinitializer, <4 x i32> %19
%21 = add <4 x i32> %13, %20
%22 = icmp eq i64 %12, 96
br i1 %22, label %33, label %23
23: ; preds = %11
%24 = or i64 %12, 5
%25 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %24
%26 = bitcast i32* %25 to <4 x i32>*
%27 = load <4 x i32>, <4 x i32>* %26
%28 = icmp eq <4 x i32> %27, zeroinitializer
%29 = sdiv <4 x i32> %27, <i32 2, i32 2, i32 2, i32 2>
%30 = select <4 x i1> %28, <4 x i32> zeroinitializer, <4 x i32> %29
%31 = add <4 x i32> %21, %30
%32 = add nuw nsw i64 %12, 8
br label %11
33: ; preds = %11
%34 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %21)
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %34)
ret i32 0
36: ; preds = %9, %36
%37 = phi i32 [ 0, %9 ], [ %44, %36 ]
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [101 x i32], [101 x i32]* %2, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = add nsw i32 %42, 1
store i32 %43, i32* %41
%44 = add nuw nsw i32 %37, 1
%45 = load i32, i32* %1
%46 = icmp slt i32 %44, %45
br i1 %46, label %36, label %47
47: ; preds = %36, %0
br label %11
}