n=int(input()) b={0:1} def f(i): if i not in b: r=f(i//3)+f(i//5) b[i]=r return r else: return b[i] print(f(n))