#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 *, int *);
int main() {
  int currentCount = 0, maxCount = 0, stacking = 0, interest, input = 1;
  scanf("%d", &interest);
  while (1) {
    scanf("%d", &input);
    if (!input) {
      break;
    }
    if (input == interest) {
      stacking++;
      currentCount++;
    } else {
      currentCount = 0;
    }
    if (maxCount < currentCount) {
      maxCount = currentCount;
    }
  }
  printf("%d\n%d", maxCount, stacking);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xeb1(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xea1(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    117a <main+0x5a>
jmp    11bb <main+0x9b>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    119d <main+0x7d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a4 <main+0x84>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b6 <main+0x96>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    115b <main+0x3b>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe38(%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
push   %rax
movl   $0x1,(%rsp)
lea    0xeca(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    (%rsp),%eax
test   %eax,%eax
je     119c <main+0x7c>
xor    %r12d,%r12d
lea    0xea1(%rip),%r14
mov    %rsp,%r15
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax)
add    $0x1,%ebp
xor    %ecx,%ecx
cmp    0x4(%rsp),%eax
sete   %cl
cmovne %r12d,%ebp
add    %ecx,%r13d
cmp    %ebp,%ebx
cmovl  %ebp,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%eax
test   %eax,%eax
jne    1170 <main+0x50>
jmp    11a1 <main+0x81>
xor    %ebx,%ebx
xor    %r13d,%r13d
lea    0xe58(%rip),%rdi
mov    %ebx,%esi
mov    %r13d,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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