from functools import lru_cache n=int(input()) @lru_cache def f(x): if x==0: return 1 return f(x//3)+f(x//5) print(f(n))