#include
using namespace std;
long trailing_factorial_zeros(long n) {
int result = 0;
int m5 = 5;
while (n >= m5) {
result += n / m5;
m5 *= 5;
}
return result;
}
int main() {
int T=0,i;
long z=0,Z[100];
cin>>T;
cout<<"\n";
for (i=0;i<T;i++) {
cin>>Z[i];
z=trailing_factorial_zeros(Z[i]);
cout<<z<<"\n";
}
return 0;
}