n = int(input()) n_list = range(1, n+1) z = [] for i in n_list: if i % 15 == 0: z.append("zzzz") elif i % 3 == 0: z.append("zz") elif i % 5 == 0: z.append("zz") fizzbuzz = "".join(z) ans = fizzbuzz.count("z") print(ans)