N=int(input()) def seq(X): if X==0: return 1 else: return seq(X//3)+seq(X//5) print(seq(N))