import sys from collections import defaultdict sys.setrecursionlimit(10**7) N = int(input()) memo = defaultdict(int) memo[0] = 1 def dfs(X): if memo[X] > 0: return memo[X] else: a = dfs(X//3)+dfs(X//5) memo[X] = a return memo[X] print(dfs(N))