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