#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 *, long);
scalar_t__ scanf(char *, long *);
int main(int argc, char *argv[]) {
  int i;
  long int n, height, max = 0, maxCount = 0;
  scanf("%ld", &n);
  while (scanf("%ld", &height) != EOF) {
    if (height > max) {
      maxCount = 1;
      max = height;
    } else if (height == max) {
      maxCount++;
    }
  }
  printf("%ld", maxCount);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea3(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%rax
je     11bd <main+0x9d>
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jle    1199 <main+0x79>
movq   $0x1,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    11b8 <main+0x98>
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    11b3 <main+0x93>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11b8 <main+0x98>
jmp    1156 <main+0x36>
mov    -0x38(%rbp),%rsi
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%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),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x2e92(%rip),%r12
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %ebx,%ebx
jmp    11af <main+0x8f>
xor    %ecx,%ecx
mov    $0x1,%r13d
lea    0xe91(%rip),%r14
lea    0x8(%rsp),%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%rsp),%rax
xor    %ebx,%ebx
cmp    %rbp,%rax
sete   %bl
add    %rcx,%rbx
cmp    %rbp,%rax
cmovg  %rax,%rbp
cmovg  %r13,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rcx
cmp    (%r12),%rax
jne    1180 <main+0x60>
lea    0xe4a(%rip),%rdi
mov    %rbx,%rsi
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 = [4 x i8] c"%ld\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %9
store i64 0, i64* %10
%11 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %7)
br label %12
12: ; preds = %30, %2
%13 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %8)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %31
16: ; preds = %12
%17 = load i64, i64* %8
%18 = load i64, i64* %9
%19 = icmp sgt i64 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
store i64 1, i64* %10
%21 = load i64, i64* %8
store i64 %21, i64* %9
br label %30
22: ; preds = %16
%23 = load i64, i64* %8
%24 = load i64, i64* %9
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = load i64, i64* %10
%28 = add nsw i64 %27, 1
store i64 %28, i64* %10
br label %29
29: ; preds = %26, %22
br label %30
30: ; preds = %29, %20
br label %12
31: ; preds = %12
%32 = load i64, i64* %10
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %32)
ret i32 0
}

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