#include <bits/stdc++.h>

using namespace std;

int main()

{

unsigned long long int t,n,res=0,temp;

cin>>t;

while(t–)

{

cin>>n;

res=n/5;

temp=res;

while(temp>5)

{

temp=temp/5;

res+=temp;

}

cout<<res<<"\n";

}

}

/*getting correct output for test cases but while submitting getting wrong answer*/