#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 *, long);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int count, entries;
  long int number;
  long int wahdan = 0;
  scanf("%d", &entries);
  for (count = 1; count <= entries; count++) {
    wahdan = 0;
    scanf("%ld", &number);
    while (number) {
      number /= 5;
      wahdan += number;
    }
    printf("%ld\n", wahdan);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xec2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11c2 <main+0xa2>
movq   $0x0,-0x20(%rbp)
lea    0xe98(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpq   $0x0,-0x18(%rbp)
je     11a4 <main+0x84>
mov    -0x18(%rbp),%rax
mov    $0x5,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1176 <main+0x56>
mov    -0x20(%rbp),%rsi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x30>
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    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11ca <main+0xaa>
mov    $0x1,%r13d
lea    0xeab(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xea3(%rip),%r12
movabs $0x6666666666666667,%rbx
66 66 66
jmp    1186 <main+0x66>
mov    %r12,%rdi
call   1030 <printf@plt>
lea    0x1(%r13),%eax
cmp    0x4(%rsp),%r13d
mov    %eax,%r13d
jge    11ca <main+0xaa>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%rdx
xor    %esi,%esi
test   %rdx,%rdx
je     1170 <main+0x50>
nop
mov    %rdx,%rcx
mov    %rdx,%rax
imul   %rbx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    %rdx
add    %rax,%rdx
add    %rdx,%rsi
add    $0x4,%rcx
cmp    $0x8,%rcx
ja     11a0 <main+0x80>
mov    %rdx,0x8(%rsp)
jmp    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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