def sequence(n): if n==0: return 1 else: return sequence(int(n/3))+sequence(int(n/5)) def com(a,b): N=1 i=b if a==b or b==0: return 1 else: while i>=1: N*=a a-=1 i-=1 while b>=1: N/=b b-=1 return N N=int(input()) i=0 j=0 M=N total=0 while M>1: M=M/5 i+=1 while j<=i: total+=com(i,j)*sequence(int(M*((5/3)**j))) j+=1 print('%d'%total)