#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, long *);
int main() {
  FILE *in, *out;
  in = fopen("input.txt", "r");
  out = fopen("output.txt", "w");
  long int n, temp;
  int tot;
  fscanf(in, "%ld", &n);
  temp = n;
  if (n % temp == 0)
    tot++;
  temp = temp / 2;
  while (temp > 0) {
    if (n % temp == 0)
      tot++;
    temp--;
  }
  fprintf(out, "%d", tot);
  fclose(in);
  fclose(out);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xead(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9f(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cqto
idivq  -0x28(%rbp)
cmp    $0x0,%rdx
jne    11b6 <main+0x76>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jle    1201 <main+0xc1>
mov    -0x20(%rbp),%rax
cqto
idivq  -0x28(%rbp)
cmp    $0x0,%rdx
jne    11f0 <main+0xb0>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
jmp    11c8 <main+0x88>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xe0e(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r14
lea    0xeab(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xea2(%rip),%rsi
mov    %rsp,%rdx
mov    %r14,%rdi
call   1040 <fscanf@plt>
mov    (%rsp),%rsi
mov    %rsi,%rdi
shr    %rdi
jmp    11ac <main+0x6c>
xchg   %ax,%ax
mov    %rsi,%rax
xor    %edx,%edx
div    %rdi
cmp    $0x1,%rdx
adc    $0x0,%ecx
lea    -0x1(%rdi),%rax
cmp    $0x1,%rdi
mov    %rax,%rdi
jbe    11c0 <main+0x80>
mov    %rsi,%rax
or     %rdi,%rax
shr    $0x20,%rax
jne    1190 <main+0x50>
mov    %esi,%eax
xor    %edx,%edx
div    %edi
jmp    1198 <main+0x58>
lea    0xe56(%rip),%rsi
mov    %rbx,%rdi
mov    %ecx,%edx
call   1050 <fprintf@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"output.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [4 x i8] c"%ld\00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %2
%8 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %8, i32** %3
%9 = load i32*, i32** %2
%10 = call i32 @fscanf(i32* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %4)
%11 = load i64, i64* %4
store i64 %11, i64* %5
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = srem i64 %12, %13
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %19
19: ; preds = %16, %0
%20 = load i64, i64* %5
%21 = sdiv i64 %20, 2
store i64 %21, i64* %5
br label %22
22: ; preds = %33, %19
%23 = load i64, i64* %5
%24 = icmp sgt i64 %23, 0
br i1 %24, label %25, label %36
25: ; preds = %22
%26 = load i64, i64* %4
%27 = load i64, i64* %5
%28 = srem i64 %26, %27
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %33
33: ; preds = %30, %25
%34 = load i64, i64* %5
%35 = add nsw i64 %34, -1
store i64 %35, i64* %5
br label %22
36: ; preds = %22
%37 = load i32*, i32** %3
%38 = load i32, i32* %6
%39 = call i32 @fprintf(i32* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %38)
%40 = load i32*, i32** %2
%41 = call i32 @fclose(i32* %40)
%42 = load i32*, i32** %3
%43 = call i32 @fclose(i32* %42)
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"output.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [4 x i8] c"%ld\00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i64
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%4 = bitcast i64* %1 to i8*
%5 = call i32 @fscanf(i32* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %1)
%6 = load i64, i64* %1
%7 = lshr i64 %6, 1
%8 = icmp sgt i64 %6, 1
br label %9
9: ; preds = %0, %9
%10 = phi i32 [ %15, %9 ], [ undef, %0 ]
%11 = phi i64 [ %16, %9 ], [ %7, %0 ]
%12 = urem i64 %6, %11
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = add nsw i32 %10, %14
%16 = add nsw i64 %11, -1
%17 = icmp ugt i64 %11, 1
br i1 %17, label %9, label %18
18: ; preds = %9
%19 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %15)
%20 = call i32 @fclose(i32* %2)
%21 = call i32 @fclose(i32* %3)
ret i32 0
}