N = int(input()) memo = {0: 1} def dfs(x): if x in memo: return memo[x] memo[x] = dfs(x // 3) + dfs(x // 5) return memo[x] print(dfs(N))