#include <iostream>
#include <cmath>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int n;
cin>>n;
while(n--){
int a,sum=0;
cin>>a;
while(a>=1){
for(int i=1;i<=a;i*=2){
sum++;
}
for(int i=5;i<=a;i*=5){
sum++;
}
a/=10;
}
cout<<sum-1<<endl;
}
return 0;
}
幹你好天才 跪了