#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*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int strlen(char *);
int main(int argc, char *argv[]) {
  freopen("harem.in", "r", stdin);
  freopen("harem.out", "w+", stdout);
  char command[55];
  long long n;
  scanf("%I64d", &n);
  scanf("%s", command);
  if (strlen(command) == 1) {
    if (command[0] == 'N')
      printf("1");
    else
      printf("%I64d", n);
    return 0;
  } else if (strlen(command) == 2 && command[0] == 'N' && command[1] == 'H') {
    printf("%I64d", (n + 1) / 2);
  } else {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
lea    0xe9a(%rip),%rdi
lea    0xe9c(%rip),%rsi
call   1050 <freopen@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edx
lea    0xe89(%rip),%rdi
lea    0xe8c(%rip),%rsi
call   1050 <freopen@plt>
lea    0xe83(%rip),%rdi
lea    -0x58(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    1202 <main+0xc2>
movsbl -0x50(%rbp),%eax
cmp    $0x4e,%eax
jne    11e4 <main+0xa4>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f6 <main+0xb6>
mov    -0x58(%rbp),%rsi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1267 <main+0x127>
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1256 <main+0x116>
movsbl -0x50(%rbp),%eax
cmp    $0x4e,%eax
jne    1256 <main+0x116>
movsbl -0x4f(%rbp),%eax
cmp    $0x48,%eax
jne    1256 <main+0x116>
mov    -0x58(%rbp),%rax
add    $0x1,%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rsi
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    125b <main+0x11b>
jmp    125b <main+0x11b>
jmp    1260 <main+0x120>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
lea    0xe9b(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1060 <freopen@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edx
lea    0xe8a(%rip),%rdi
lea    0xe8d(%rip),%rsi
call   1060 <freopen@plt>
lea    0xe84(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe77(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jne    11d6 <main+0x86>
cmpb   $0x4e,0x10(%rsp)
jne    120d <main+0xbd>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    1220 <main+0xd0>
lea    0x10(%rsp),%rdi
call   1040 <strlen@plt>
cmp    $0x2,%eax
jne    1220 <main+0xd0>
cmpb   $0x4e,0x10(%rsp)
jne    1220 <main+0xd0>
cmpb   $0x48,0x11(%rsp)
jne    1220 <main+0xd0>
mov    0x8(%rsp),%rax
lea    0x1(%rax),%rcx
shr    $0x3f,%rcx
lea    (%rax,%rcx,1),%rsi
add    $0x1,%rsi
sar    %rsi
jmp    1212 <main+0xc2>
mov    0x8(%rsp),%rsi
lea    0xdff(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"harem.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [10 x i8] c"harem.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
@.str.4 = [6 x i8] c"%I64d\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [2 x i8] c"1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [55 x i8]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @stdin
%9 = call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stdout
%11 = call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64* %7)
%13 = getelementptr inbounds [55 x i8], [55 x i8]* %6, i64 0, i64 0
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [55 x i8], [55 x i8]* %6, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %29
18: ; preds = %2
%19 = getelementptr inbounds [55 x i8], [55 x i8]* %6, i64 0, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 78
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %28
25: ; preds = %18
%26 = load i64, i64* %7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64 %26)
br label %28
28: ; preds = %25, %23
store i32 0, i32* %3
br label %51
29: ; preds = %2
%30 = getelementptr inbounds [55 x i8], [55 x i8]* %6, i64 0, i64 0
%31 = call i32 @strlen(i8* %30)
%32 = icmp eq i32 %31, 2
br i1 %32, label %33, label %48
33: ; preds = %29
%34 = getelementptr inbounds [55 x i8], [55 x i8]* %6, i64 0, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 78
br i1 %37, label %38, label %48
38: ; preds = %33
%39 = getelementptr inbounds [55 x i8], [55 x i8]* %6, i64 0, i64 1
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 72
br i1 %42, label %43, label %48
43: ; preds = %38
%44 = load i64, i64* %7
%45 = add nsw i64 %44, 1
%46 = sdiv i64 %45, 2
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64 %46)
br label %49
48: ; preds = %38, %33, %29
br label %49
49: ; preds = %48, %43
br label %50
50: ; preds = %49
store i32 0, i32* %3
br label %51
51: ; preds = %50, %28
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
@.str = [9 x i8] c"harem.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [10 x i8] c"harem.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
@.str.4 = [6 x i8] c"%I64d\00"
@.str.5 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [55 x i8]
%4 = alloca i64
%5 = load i32, i32* @stdin
%6 = tail call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [55 x i8], [55 x i8]* %3, i64 0, i64 0
%10 = bitcast i64* %4 to i8*
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64* %4)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%13 = call i32 @strlen(i8* %9)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %23
15: ; preds = %2
%16 = load i8, i8* %9
%17 = icmp eq i8 %16, 78
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @putchar(i32 49)
br label %38
20: ; preds = %15
%21 = load i64, i64* %4
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64 %21)
br label %38
23: ; preds = %2
%24 = call i32 @strlen(i8* %9)
%25 = icmp eq i32 %24, 2
%26 = load i8, i8* %9
%27 = icmp eq i8 %26, 78
%28 = select i1 %25, i1 %27, i1 false
%29 = getelementptr inbounds [55 x i8], [55 x i8]* %3, i64 0, i64 1
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 72
%32 = select i1 %28, i1 %31, i1 false
br i1 %32, label %33, label %38
33: ; preds = %23
%34 = load i64, i64* %4
%35 = add nsw i64 %34, 1
%36 = sdiv i64 %35, 2
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64 %36)
br label %38
38: ; preds = %23, %33, %18, %20
ret i32 0
}