#include <iostream>
using namespace std;

int two,five;

int factorial(int x) {

  if(x != 1) {
    int x1;
    x1 = x;
    while(x1 % 5 == 0) {
      five++;
      x1 = x1 / 5;
      if(x1 < 5) break;
    }
    while(x1 % 2 == 0) {
      two++;
      x1 = x1 / 2;
      if(x1 < 2) break;
    }
    factorial(x-1);
  }
  if( x == 1) return 0;
}

int main() {
  int a,b;
  while(cin >> a) {
    factorial(a);
    if(two >= five)
      cout << five << endl;
    else if(two < five)
      cout << two << endl;
    two = 0;
    five = 0;
}
}