N=int(input()) list=[] def sequence(n): if n==0: return 1 else: return sequence(int(n/3))+sequence(int(n/5)) print('%d'%sequence(N))