n = int(input()) n_list = range(1, n+1) z = 0 for i in n_list: if i % 15 == 0: z += 4#FizzBuzz elif i % 3 == 0: z += 2#Fizz elif i % 5 == 0: z += 2#Buzz print(z)