MOD = 10 ** 9 + 7 INF = 10 ** 15 import sys sys.setrecursionlimit(100000000) def dfs(x): if x == 0: return 1 return dfs(x//3) + dfs(x//5) def main(): N = int(input()) print(dfs(N)) if __name__ == '__main__': main()