#include int main(){ int z; int n,x,p; scanf("%d",&z); while(z--){ scanf("%d",&x); for(n=0,p=5;p<=x;p*=5) n+=x/p; printf("%d\n",n); } return(0); }