a = {0: 1} def get(i): if i not in a: n = get(i // 3) + get(i // 5) a[i] = n return n else: return a[i] print(get(int(input())))