#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ scanf(char *, int *, int *, int *);
int main(void) {
  int l1, l2, l3, rec = 0, loz = 0;
  while (scanf("%d,%d,%d", &l1, &l2, &l3) != EOF) {
    if (l1 * l1 + l2 * l2 == l3 * l3)
      rec++;
    if (l1 == l2)
      loz++;
  }
  printf("%d\n%d\n", rec, loz);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%rax
je     11a7 <main+0x87>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jne    118d <main+0x6d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11a2 <main+0x82>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113d <main+0x1d>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe55(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x2e98(%rip),%r14
xor    %ebp,%ebp
mov    $0x0,%ebx
cmp    (%r14),%rax
je     11b8 <main+0x98>
xor    %ebx,%ebx
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%r13
xor    %ebp,%ebp
nop
mov    0x14(%rsp),%eax
mov    %eax,%ecx
imul   %eax,%ecx
mov    0x10(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
add    %ecx,%esi
mov    0xc(%rsp),%ecx
imul   %ecx,%ecx
xor    %edi,%edi
cmp    %ecx,%esi
sete   %dil
add    %edi,%ebp
xor    %ecx,%ecx
cmp    %edx,%eax
sete   %cl
add    %ecx,%ebx
lea    0xe5b(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1040 <scanf@plt>
cmp    (%r14),%rax
jne    1170 <main+0x50>
lea    0xe4a(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d,%d,%d\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%d\0A%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* %5
store i32 0, i32* %6
br label %7
7: ; preds = %33, %0
%8 = call i64 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %34
11: ; preds = %7
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = mul nsw i32 %15, %16
%18 = add nsw i32 %14, %17
%19 = load i32, i32* %4
%20 = load i32, i32* %4
%21 = mul nsw i32 %19, %20
%22 = icmp eq i32 %18, %21
br i1 %22, label %23, label %26
23: ; preds = %11
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %26
26: ; preds = %23, %11
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %33
33: ; preds = %30, %26
br label %7
34: ; preds = %7
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %35, i32 %36)
ret i32 0
}

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