#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 t, n, count;
  scanf("%d", &t);
  while (t--) {
    count = 0;
    scanf("%d", &n);
    while (n >= 5) {
      count += n / 5;
      n /= 5;
    }
    printf("%d\n", count);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11ac <main+0x8c>
movl   $0x0,-0x10(%rbp)
lea    0xe9f(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x5,-0xc(%rbp)
jl     1198 <main+0x78>
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    116a <main+0x4a>
mov    -0x10(%rbp),%esi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jae    114e <main+0x2e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xeab(%rip),%r14
mov    %rsp,%r15
mov    $0xcccccccd,%ebx
lea    0xe9f(%rip),%r12
jmp    117f <main+0x5f>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <printf@plt>
subl   $0x1,0x4(%rsp)
jb     1140 <main+0x20>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%eax
xor    %esi,%esi
cmp    $0x5,%eax
jl     1170 <main+0x50>
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
mov    %eax,%eax
imul   %rbx,%rax
shr    $0x22,%rax
add    %eax,%esi
cmp    $0x18,%ecx
ja     11a0 <main+0x80>
mov    %eax,(%rsp)
jmp    1170 <main+0x50>

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