#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 teams, probs = 0, team[3];
  scanf("%d", &teams);
  while (teams--) {
    scanf("%d %d %d", &team[0], &team[1], &team[2]);
    if (team[0] + team[1] + team[2] >= 2)
      probs++;
  }
  printf("%d", probs);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec9(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     119e <main+0x7e>
lea    -0x18(%rbp),%rsi
lea    -0x18(%rbp),%rdx
add    $0x4,%rdx
lea    -0x18(%rbp),%rcx
add    $0x8,%rcx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x2,%eax
jl     1199 <main+0x79>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <main+0x28>
mov    -0xc(%rbp),%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xed2(%rip),%rdi
xor    %ebx,%ebx
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,(%rsp)
jb     118f <main+0x6f>
lea    0x8(%rsp),%r14
lea    0xc(%rsp),%r15
lea    0xea9(%rip),%r12
lea    0x4(%rsp),%r13
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
add    0x4(%rsp),%eax
add    0xc(%rsp),%eax
xor    %ecx,%ecx
cmp    $0x2,%eax
setge  %cl
add    %ecx,%ebx
subl   $0x1,(%rsp)
jae    1160 <main+0x40>
lea    0xe70(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [3 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
%5 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %27, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
%14 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %11, i32* %12, i32* %13)
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%16 = load i32, i32* %15
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%18 = load i32, i32* %17
%19 = add nsw i32 %16, %18
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
%21 = load i32, i32* %20
%22 = add nsw i32 %19, %21
%23 = icmp sge i32 %22, 2
br i1 %23, label %24, label %27
24: ; preds = %10
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %27
27: ; preds = %24, %10
br label %6
28: ; preds = %6
%29 = load i32, i32* %3
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
ret i32 0
}

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