#include <iostream>
using namespace std;

int main(){
  long long a;
  while(1){
    cin>>a;
    int x=a/5+a/5/5+a/5/5/5+a/5/5/5/5+a/5/5/5/5/5+a/5/5/5/5/5/5+a/5/5/5/5/5/5/5+a/5/5/5/5/5/5/5/5;
    cout<<x<<endl;
    if(a==0) break;
  }
  return 0;
}
