#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);
int /*<<< orphan*/ scanf(char *, ...);
scalar_t__ strcmp(char *, char *);
int main(void) {
  int num, tarou = 0, hanako = 0, i;
  char t[100], h[100];
  scanf("%d\n", &num);
  for (i = 0; i < num; i++) {
    scanf("%s %s\n", t, h);
    if (strcmp(t, h) > 0) {
      tarou += 3;
    } else if (strcmp(t, h) < 0) {
      hanako += 3;
    } else {
      tarou++;
      hanako++;
    }
  }
  printf("%d %d\n", tarou, hanako);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1208 <main+0xd8>
lea    -0x80(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jle    11b6 <main+0x86>
mov    -0xc(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xc(%rbp)
jmp    11f5 <main+0xc5>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jge    11de <main+0xae>
mov    -0x10(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x10(%rbp)
jmp    11f0 <main+0xc0>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11f5 <main+0xc5>
jmp    11fa <main+0xca>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <main+0x39>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xdf2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
lea    0xec2(%rip),%rdi
xor    %ebx,%ebx
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
mov    $0x0,%r15d
jle    11d9 <main+0xa9>
lea    0xe96(%rip),%r14
lea    0x80(%rsp),%r12
lea    0x10(%rsp),%r13
xor    %ebp,%ebp
xor    %r15d,%r15d
xor    %ebx,%ebx
jmp    118c <main+0x5c>
add    $0x3,%ebx
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jge    11d9 <main+0xa9>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jg     1180 <main+0x50>
mov    %r12,%rdi
mov    %r13,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jns    11d0 <main+0xa0>
add    $0x3,%r15d
jmp    1183 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
add    $0x1,%r15d
jmp    1183 <main+0x53>
lea    0xe27(%rip),%rdi
mov    %ebx,%esi
mov    %r15d,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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