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