#include <bits/stdc++.h>

#define stirng string
#define vvi vector<vector<int>>
#define vi vector<int>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

const int inf = 1e9 + 7;

int main() {
  int n;
  while (cin >> n && n != 0) {
    int k = 1;
    for (int i = 1; i <= n; i++) {
      k *= i;
    }
    int ans = 0;
    string s = to_string(k);
    for (int i = 0; i < s.size(); i++) {
      if (s[s.size() - 1 - i] == '0') {
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

