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