#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 array_pos(char);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int counter[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  int curr_max = 0;
  for (int i = 0; i < 5; i++) {
    char card[3];
    scanf("%s", card);
    int rank = array_pos(card[0]);
    counter[rank] += 1;
    if (counter[rank] > curr_max)
      curr_max = counter[rank];
  }
  printf("%d\n", curr_max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x34,%edx
call   1040 <memset@plt>
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0x5,-0x48(%rbp)
jge    11d1 <main+0x91>
lea    -0x4b(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1050 <scanf@plt>
movsbl -0x4b(%rbp),%edi
call   1060 <array_pos@plt>
mov    %eax,-0x50(%rbp)
movslq -0x50(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x40(%rbp,%rax,4)
movslq -0x50(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
cmp    -0x44(%rbp),%eax
jle    11be <main+0x7e>
movslq -0x50(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x44(%rbp)
jmp    11c3 <main+0x83>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    116d <main+0x2d>
mov    -0x44(%rbp),%esi
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x40(%rsp)
lea    0xea7(%rip),%rbx
lea    0xd(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsbl 0xd(%rsp),%edi
call   1050 <array_pos@plt>
cltq
mov    0x10(%rsp,%rax,4),%ecx
lea    0x1(%rcx),%ebp
mov    %ebp,0x10(%rsp,%rax,4)
xor    %eax,%eax
test   %ecx,%ecx
cmovs  %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsbl 0xd(%rsp),%edi
call   1050 <array_pos@plt>
cltq
mov    0x10(%rsp,%rax,4),%ecx
lea    0x1(%rcx),%edx
mov    %edx,0x10(%rsp,%rax,4)
cmp    %ebp,%ecx
cmovge %edx,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsbl 0xd(%rsp),%edi
call   1050 <array_pos@plt>
cltq
mov    0x10(%rsp,%rax,4),%ecx
lea    0x1(%rcx),%edx
mov    %edx,0x10(%rsp,%rax,4)
cmp    %ebp,%ecx
cmovge %edx,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsbl 0xd(%rsp),%edi
call   1050 <array_pos@plt>
cltq
mov    0x10(%rsp,%rax,4),%ecx
lea    0x1(%rcx),%edx
mov    %edx,0x10(%rsp,%rax,4)
cmp    %ebp,%ecx
cmovge %edx,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movsbl 0xd(%rsp),%edi
call   1050 <array_pos@plt>
cltq
mov    0x10(%rsp,%rax,4),%eax
lea    0x1(%rax),%esi
cmp    %ebp,%eax
cmovl  %ebp,%esi
lea    0xddd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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