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