is_div = lambda x, y: int(not(x % y)) N, s = int(input()), 0 for i in range(1, N+1): s += (is_div(i, 3) + is_div(i, 5))*2 print(s)