from math import floor n = int(input()) memo = {} def a(i): if i in memo: return memo[i] else: memo[i] = a_inner(i) return memo[i] def a_inner(i): if i == 0: return 1 else: i3 = floor(i / 3) i5 = floor(i / 5) return a(i3) + a(i5) print(a(n))