#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 *);
void main() {
  int x, i, m, n = 0;
  scanf("%d", &x);
  for (i = 5; i <= x; i += 5) {
    m = i;
    while (m % 5 == 0) {
      n++;
      m = m / 5;
    }
  }
  printf("%d", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x10(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     119b <main+0x7b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1188 <main+0x68>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1158 <main+0x38>
jmp    118d <main+0x6d>
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x26>
mov    -0x10(%rbp),%esi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%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    $0x5,%eax
jl     1195 <main+0x75>
mov    $0x5,%ecx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%edx
cs nopw 0x0(%rax,%rax,1)
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     1160 <main+0x40>
add    $0x5,%ecx
cmp    %eax,%ecx
jle    1150 <main+0x30>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
store i32 5, i32* %2
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %25
10: ; preds = %6
%11 = load i32, i32* %2
store i32 %11, i32* %3
br label %12
12: ; preds = %16, %10
%13 = load i32, i32* %3
%14 = srem i32 %13, 5
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = sdiv i32 %19, 5
store i32 %20, i32* %3
br label %12
21: ; preds = %12
br label %22
22: ; preds = %21
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 5
store i32 %24, i32* %2
br label %6
25: ; preds = %6
%26 = load i32, i32* %4
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %26)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @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, 5
br i1 %5, label %19, label %6
6: ; preds = %0, %16
%7 = phi i32 [ %12, %16 ], [ 0, %0 ]
%8 = phi i32 [ %17, %16 ], [ 5, %0 ]
br label %9
9: ; preds = %6, %9
%10 = phi i32 [ %12, %9 ], [ %7, %6 ]
%11 = phi i32 [ %13, %9 ], [ %8, %6 ]
%12 = add nsw i32 %10, 1
%13 = sdiv i32 %11, 5
%14 = srem i32 %13, 5
%15 = icmp eq i32 %14, 0
br i1 %15, label %9, label %16
16: ; preds = %9
%17 = add nuw nsw i32 %8, 5
%18 = icmp sgt i32 %17, %4
br i1 %18, label %19, label %6
19: ; preds = %16, %0
%20 = phi i32 [ 0, %0 ], [ %12, %16 ]
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
ret void
}