fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. long long n, m = 5, s = 0;
  5. cin >> n;
  6. while(n >= m){
  7. s = s + (n / m);
  8. m = m * 5;
  9. }
  10. cout << s;
  11. return 0;
  12. }
Success #stdin #stdout 0s 4524KB
stdin
12
stdout
2