#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 ts = 0, n;
  scanf("%d", &n);
  while (n--) {
    int a = 0, b = 0, c = 0;
    scanf("%d %d %d", &a, &b, &c);
    if ((a + b + c) > 1)
      ts++;
  }
  printf("%d\n", ts);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec9(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     11ab <main+0x8b>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xe88(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cmp    $0x1,%eax
jle    11a6 <main+0x86>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <main+0x28>
mov    -0x8(%rbp),%esi
lea    0xe54(%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
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0xc(%rsp)
jb     11a6 <main+0x86>
lea    0xeb0(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%r13
xor    %ebx,%ebx
nop
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    0x8(%rsp),%eax
add    (%rsp),%eax
xor    %ecx,%ecx
cmp    $0x2,%eax
setge  %cl
add    %ecx,%ebx
subl   $0x1,0xc(%rsp)
jae    1160 <main+0x40>
lea    0xe5c(%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"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %8
8: ; preds = %23, %0
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
store i32 %10, i32* %3
%11 = icmp ne i32 %9, 0
br i1 %11, label %12, label %24
12: ; preds = %8
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
%19 = icmp sgt i32 %18, 1
br i1 %19, label %20, label %23
20: ; preds = %12
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %23
23: ; preds = %20, %12
br label %8
24: ; preds = %8
%25 = load i32, i32* %2
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %25)
ret i32 0
}

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