n = int(input()) dp = dict() dp[0] = 1 def dfs(x): if x in dp: return dp[x] dp[x] = dfs(x // 3) + dfs(x // 5) return dp[x] print(dfs(n))