import sys sys.setrecursionlimit(10 ** 6) n = int(input()) memo = {} memo[0] = 1 def a(x): if memo.get(x, None) is None: ans = a(x // 3) + a(x // 5) memo[x] = ans return memo[x] print(a(n))