import std.stdio;
import std.conv;
import std.string;

void main(){

  int[100] n;

  int num=0;
  while(true){
		n[num] = to!(int)(chomp(readln()));
    if(n[num] == 0){
      break;
    }
    num++;
  }

  for(int i=0; i<num; i++){
		writef("%d\n", calZero(n[i]));
  }

}

int calZero(int num){
	int devide = 5;
  int ret = 0;
  while(true){
		ret += num / devide;
    devide *= 5;
    if(num < devide)	break;
  }
  return ret;
}