N = int(input()) t = 0 for i in range(1, N + 1): if i % 15 == 0: t += 4 elif i % 3 == 0: t += 2 elif i % 5 == 0: t += 2 # print(l) # print(l.count("z")) print(t)