#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;
scalar_t__ fscanf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char l;
  int count = 1;
  while (fscanf(stdin, "%c", &l) != EOF) {
    count += (l >= 65 && l <= 90);
  }
  printf("%d", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
lea    -0x11(%rbp),%rdx
call   1040 <fscanf@plt>
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
je     1198 <main+0x78>
movsbl -0x11(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x19(%rbp)
jl     1185 <main+0x65>
movsbl -0x11(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    113d <main+0x1d>
mov    -0x18(%rbp),%esi
lea    0xe61(%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
mov    0x2eb4(%rip),%r12
mov    (%r12),%edi
lea    0xec1(%rip),%rsi
lea    0xf(%rsp),%rdx
call   1040 <fscanf@plt>
mov    0x2e90(%rip),%r13
mov    $0x1,%ebx
cmp    0x0(%r13),%rax
je     1191 <main+0x71>
mov    $0x1,%ebx
lea    0xe99(%rip),%r14
lea    0xf(%rsp),%r15
nopl   0x0(%rax)
movzbl 0xf(%rsp),%eax
add    $0xbf,%al
cmp    $0x1a,%al
adc    $0x0,%ebx
mov    (%r12),%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <fscanf@plt>
cmp    0x0(%r13),%rax
jne    1170 <main+0x50>
lea    0xe6b(%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):
@stdin = global i32 0
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
br label %8
8: ; preds = %21, %2
%9 = load i32, i32* @stdin
%10 = call i64 @fscanf(i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %8
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i8, i8* %6
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 90
br label %21
21: ; preds = %17, %13
%22 = phi i1 [ false, %13 ], [ %20, %17 ]
%23 = zext i1 %22 to i32
%24 = load i32, i32* %7
%25 = add nsw i32 %24, %23
store i32 %25, i32* %7
br label %8
26: ; preds = %8
%27 = load i32, i32* %7
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %27)
ret i32 0
}

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