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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a2 <main+0x82>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118f <main+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    115f <main+0x3f>
jmp    1194 <main+0x74>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
mov    -0x14(%rbp),%esi
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %esi,%esi
cmp    $0x2,%eax
jge    114d <main+0x2d>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x2,%ecx
xor    %esi,%esi
jmp    1169 <main+0x49>
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%rcx),%edx
cmp    %eax,%ecx
mov    %edx,%ecx
je     113d <main+0x1d>
imul   $0xcccccccd,%ecx,%edx
cmp    $0x33333333,%edx
ja     1160 <main+0x40>
mov    %ecx,%edx
nopl   0x0(%rax)
add    $0x1,%esi
movslq %edx,%rdx
imul   $0x66666667,%rdx,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
sar    $0x21,%rdx
add    %edi,%edx
imul   $0xcccccccd,%edx,%edi
add    $0x19999999,%edi
cmp    $0x33333333,%edi
jb     1180 <main+0x60>
jmp    1160 <main+0x40>

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
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %5
store i32 2, i32* %3
br label %7
7: ; preds = %23, %0
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = load i32, i32* %3
store i32 %12, i32* %4
br label %13
13: ; preds = %17, %11
%14 = load i32, i32* %4
%15 = srem i32 %14, 5
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
%20 = load i32, i32* %4
%21 = sdiv i32 %20, 5
store i32 %21, i32* %4
br label %13
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %7
26: ; preds = %7
%27 = load i32, i32* %5
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
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 = load i32, i32* %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %22, label %6
6: ; preds = %0, %18
%7 = phi i32 [ %19, %18 ], [ 0, %0 ]
%8 = phi i32 [ %20, %18 ], [ 2, %0 ]
%9 = urem i32 %8, 5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %6, %11
%12 = phi i32 [ %14, %11 ], [ %7, %6 ]
%13 = phi i32 [ %15, %11 ], [ %8, %6 ]
%14 = add nsw i32 %12, 1
%15 = sdiv i32 %13, 5
%16 = srem i32 %15, 5
%17 = icmp eq i32 %16, 0
br i1 %17, label %11, label %18
18: ; preds = %11, %6
%19 = phi i32 [ %7, %6 ], [ %14, %11 ]
%20 = add nuw i32 %8, 1
%21 = icmp eq i32 %8, %4
br i1 %21, label %22, label %6
22: ; preds = %18, %0
%23 = phi i32 [ 0, %0 ], [ %19, %18 ]
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
ret i32 0
}