#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int i, j, k, n, m;
  while (scanf("%d", &n) != EOF) {
    m = 0;
    while (n > 0) {
      m += n / 5;
      n /= 5;
    }
    printf("%d\n", m);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1198 <main+0x78>
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1184 <main+0x64>
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
jmp    1156 <main+0x36>
mov    -0x18(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea3(%rip),%r12
cmp    (%r12),%rax
jne    115b <main+0x3b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    $0xcccccccd,%ebx
lea    0xe9c(%rip),%r14
lea    0xe92(%rip),%r15
lea    0xc(%rsp),%r13
jmp    1199 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
je     114b <main+0x2b>
mov    0xc(%rsp),%eax
xor    %esi,%esi
test   %eax,%eax
jle    1180 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
mov    %eax,%eax
imul   %rbx,%rax
shr    $0x22,%rax
add    %eax,%esi
cmp    $0x4,%ecx
ja     11b0 <main+0x90>
mov    %eax,0xc(%rsp)
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.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
%6 = alloca i32
store i32 0, i32* %1
br label %7
7: ; preds = %22, %0
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %7
store i32 0, i32* %6
br label %12
12: ; preds = %15, %11
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %5
%17 = sdiv i32 %16, 5
%18 = load i32, i32* %6
%19 = add nsw i32 %18, %17
store i32 %19, i32* %6
%20 = load i32, i32* %5
%21 = sdiv i32 %20, 5
store i32 %21, i32* %5
br label %12
22: ; preds = %12
%23 = load i32, i32* %6
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %7
25: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %22, label %6
6: ; preds = %0, %16
%7 = load i32, i32* %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6, %9
%10 = phi i32 [ %13, %9 ], [ 0, %6 ]
%11 = phi i32 [ %12, %9 ], [ %7, %6 ]
%12 = udiv i32 %11, 5
%13 = add nuw nsw i32 %10, %12
%14 = icmp ult i32 %11, 5
br i1 %14, label %15, label %9
15: ; preds = %9
store i32 %12, i32* %1
br label %16
16: ; preds = %15, %6
%17 = phi i32 [ %13, %15 ], [ 0, %6 ]
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%20 = load i64, i64* @EOF
%21 = icmp eq i64 %19, %20
br i1 %21, label %22, label %6
22: ; preds = %16, %0
ret i32 0
}