from collections import defaultdict memo = defaultdict(int) memo[0] = 1 def f(n): if memo[n] != 0: return memo[n] memo[n] = f(n//3) + f(n//5) return memo[n] print(f(int(input())))