#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 *, short);
int /*<<< orphan*/ scanf(char *, short *);
int main() {
  short n;
  scanf("%hd", &n);
  printf("%d\n", n / 5 + n / 25 + n / 125 + n / 625);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x6(%rbp),%rsi
call   1040 <scanf@plt>
movswl -0x6(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
movswl -0x6(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
movswl -0x6(%rbp),%eax
mov    $0x7d,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
movswl -0x6(%rbp),%eax
mov    $0x271,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
lea    0xe70(%rip),%rdi
movswl %ax,%esi
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    0x6(%rsp),%rsi
call   1040 <scanf@plt>
movswl 0x6(%rsp),%eax
imul   $0x6667,%eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x11,%ecx
add    %edx,%ecx
imul   $0x147b,%eax,%edx
mov    %edx,%esi
shr    $0x1f,%esi
sar    $0x11,%edx
add    %esi,%edx
add    %ecx,%edx
imul   $0xffff8313,%eax,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%esi
shr    $0xf,%ecx
sar    $0x6,%esi
add    %ecx,%esi
add    %edx,%esi
imul   $0x1a37,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x16,%eax
add    %ecx,%eax
add    %esi,%eax
movswl %ax,%esi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%hd\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %2)
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = sdiv i32 %5, 5
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = sdiv i32 %8, 25
%10 = add nsw i32 %6, %9
%11 = load i16, i16* %2
%12 = sext i16 %11 to i32
%13 = sdiv i32 %12, 125
%14 = add nsw i32 %10, %13
%15 = load i16, i16* %2
%16 = sext i16 %15 to i32
%17 = sdiv i32 %16, 625
%18 = add nsw i32 %14, %17
%19 = trunc i32 %18 to i16
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i16 signext %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%hd\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16* %1)
%4 = load i16, i16* %1
%5 = sdiv i16 %4, 5
%6 = sdiv i16 %4, 25
%7 = add nsw i16 %5, %6
%8 = sdiv i16 %4, 125
%9 = add nsw i16 %7, %8
%10 = sdiv i16 %4, 625
%11 = add nsw i16 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i16 signext %11)
ret i32 0
}