#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 scanf(char *, int *);
int sqrt(int);
int main() {
  int n, ans, i;
  while (scanf("%d", &n) == 1) {
    ans = 0;
    for (i = 2; i <= sqrt(n); i++) {
      if (n % i == 0) {
        while (n % i == 0) {
          ans++;
          n = n / i;
        }
      }
    }
    if (n > 1)
      ans++;
    printf("%d\n", ans);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11fd <main+0xcd>
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <sqrt@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jg     11d6 <main+0xa6>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11c3 <main+0x93>
jmp    1196 <main+0x66>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11be <main+0x8e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1196 <main+0x66>
jmp    11c3 <main+0x93>
jmp    11c8 <main+0x98>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1166 <main+0x36>
cmpl   $0x1,-0x8(%rbp)
jle    11e9 <main+0xb9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
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
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11e7 <main+0xb7>
lea    0xea7(%rip),%r14
lea    0xe9d(%rip),%r15
lea    0x4(%rsp),%r12
jmp    1195 <main+0x65>
nopw   0x0(%rax,%rax,1)
xor    %esi,%esi
cmpl   $0x2,0x4(%rsp)
setge  %sil
add    %ebp,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11e7 <main+0xb7>
mov    0x4(%rsp),%edi
call   1050 <sqrt@plt>
xor    %ebp,%ebp
cmp    $0x2,%eax
jl     1170 <main+0x40>
xor    %ebp,%ebp
mov    $0x2,%ebx
jmp    11c0 <main+0x90>
xchg   %ax,%ax
lea    0x1(%rbx),%r13d
call   1050 <sqrt@plt>
cmp    %eax,%ebx
mov    %r13d,%ebx
jge    1170 <main+0x40>
mov    0x4(%rsp),%edi
mov    %edi,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    11b0 <main+0x80>
nopl   (%rax)
add    $0x1,%ebp
mov    %edi,%eax
cltd
idiv   %ebx
mov    %eax,%edi
cltd
idiv   %ebx
test   %edx,%edx
je     11d0 <main+0xa0>
mov    %edi,0x4(%rsp)
jmp    11b0 <main+0x80>
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 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %42, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %45
8: ; preds = %5
store i32 0, i32* %3
store i32 2, i32* %4
br label %9
9: ; preds = %33, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %2
%12 = call i32 @sqrt(i32 %11)
%13 = icmp sle i32 %10, %12
br i1 %13, label %14, label %36
14: ; preds = %9
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %32
19: ; preds = %14
br label %20
20: ; preds = %25, %19
%21 = load i32, i32* %2
%22 = load i32, i32* %4
%23 = srem i32 %21, %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %20
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
%28 = load i32, i32* %2
%29 = load i32, i32* %4
%30 = sdiv i32 %28, %29
store i32 %30, i32* %2
br label %20
31: ; preds = %20
br label %32
32: ; preds = %31, %14
br label %33
33: ; preds = %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %9
36: ; preds = %9
%37 = load i32, i32* %2
%38 = icmp sgt i32 %37, 1
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = load i32, i32* %3
%41 = add nsw i32 %40, 1
store i32 %41, i32* %3
br label %42
42: ; preds = %39, %36
%43 = load i32, i32* %3
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
br label %5
45: ; preds = %5
ret i32 0
}

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