#yuki639 memo={} def f(x): if x==0: return 1 if x in memo: return memo[x] memo[x]=f(x/3)+f(x/5) return memo[x] n=int(raw_input()) print f(n)