#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 *, int *, int *);
int main() {
  int a[4] = {0};
  scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]);
  int i, j;
  int c = 0;
  for (i = 0; i < 4; i++) {
    for (j = i + 1; j < 4; j++) {
      if (a[i] == a[j])
        c++;
    }
  }
  int ans;
  if (c == 0)
    ans = 0;
  else if (c == 6)
    ans = 3;
  else if (c == 3 || c == 2)
    ans = 2;
  else
    ans = 1;
  printf("%d\n", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
add    $0x4,%rdx
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
lea    -0x20(%rbp),%r8
add    $0xc,%r8
lea    0xe8e(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    11e7 <main+0xb7>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x4,-0x28(%rbp)
jge    11d4 <main+0xa4>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
movslq -0x28(%rbp),%rcx
cmp    -0x20(%rbp,%rcx,4),%eax
jne    11c1 <main+0x91>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11c6 <main+0x96>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1198 <main+0x68>
jmp    11d9 <main+0xa9>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1185 <main+0x55>
cmpl   $0x0,-0x2c(%rbp)
jne    11fd <main+0xcd>
movl   $0x0,-0x30(%rbp)
jmp    1244 <main+0x114>
cmpl   $0x6,-0x2c(%rbp)
jne    1213 <main+0xe3>
movl   $0x3,-0x30(%rbp)
jmp    123f <main+0x10f>
cmpl   $0x3,-0x2c(%rbp)
je     1227 <main+0xf7>
cmpl   $0x2,-0x2c(%rbp)
jne    1233 <main+0x103>
movl   $0x2,-0x30(%rbp)
jmp    123a <main+0x10a>
movl   $0x1,-0x30(%rbp)
jmp    123f <main+0x10f>
jmp    1244 <main+0x114>
mov    -0x30(%rbp),%esi
lea    0xdbe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
lea    0xebf(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movq   0x4(%rsp),%xmm0
mov    (%rsp),%rcx
movq   %rcx,%xmm1
movsd  0x8(%rsp),%xmm2
punpcklqdq %xmm1,%xmm0
shufps $0x10,%xmm2,%xmm1
mov    0xc(%rsp),%edx
shr    $0x20,%rcx
xor    %edi,%edi
cmp    %edx,%ecx
sete   %dil
xor    %ecx,%ecx
cmp    %edx,0x8(%rsp)
pcmpeqd %xmm0,%xmm1
sete   %cl
movmskps %xmm1,%edx
mov    %edx,%eax
shr    %al
and    $0x5,%al
sub    %al,%dl
mov    %edx,%eax
and    $0x33,%al
shr    $0x2,%dl
and    $0x33,%dl
add    %al,%dl
mov    %edx,%eax
shr    $0x4,%al
add    %dl,%al
and    $0xf,%al
movzbl %al,%esi
add    %edi,%esi
add    %ecx,%esi
je     11c8 <main+0xa8>
cmp    $0x6,%esi
jne    11b8 <main+0x98>
mov    $0x3,%esi
jmp    11c8 <main+0xa8>
and    $0x1e,%esi
xor    %eax,%eax
cmp    $0x2,%esi
sete   %al
add    $0x1,%eax
mov    %eax,%esi
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 3
%7 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6)
%8 = bitcast i32* %4 to <2 x i32>*
%9 = load <2 x i32>, <2 x i32>* %8
%10 = bitcast [4 x i32]* %1 to <2 x i32>*
%11 = load <2 x i32>, <2 x i32>* %10
%12 = bitcast i32* %5 to <2 x i32>*
%13 = load <2 x i32>, <2 x i32>* %12
%14 = shufflevector <2 x i32> %9, <2 x i32> %11, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%15 = shufflevector <2 x i32> %11, <2 x i32> undef, <4 x i32> <i32 0, i32 0, i32 undef, i32 undef>
%16 = shufflevector <2 x i32> %13, <2 x i32> poison, <4 x i32> <i32 1, i32 0, i32 undef, i32 undef>
%17 = shufflevector <4 x i32> %15, <4 x i32> %16, <4 x i32> <i32 0, i32 1, i32 4, i32 5>
%18 = icmp eq <4 x i32> %14, %17
%19 = load i32, i32* %6
%20 = extractelement <2 x i32> %11, i64 1
%21 = icmp eq i32 %20, %19
%22 = zext i1 %21 to i32
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, %19
%25 = zext i1 %24 to i32
%26 = bitcast <4 x i1> %18 to i4
%27 = call i4 @llvm.ctpop.i4(i4 %26)
%28 = zext i4 %27 to i32
%29 = add nuw nsw i32 %28, %22
%30 = add nuw nsw i32 %29, %25
switch i32 %30, label %32 [
i32 0, label %36
i32 6, label %31
]
31: ; preds = %0
br label %36
32: ; preds = %0
%33 = and i32 %30, 30
%34 = icmp eq i32 %33, 2
%35 = select i1 %34, i32 2, i32 1
br label %36
36: ; preds = %32, %0, %31
%37 = phi i32 [ 3, %31 ], [ %30, %0 ], [ %35, %32 ]
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
ret i32 0
}