n = int(input()) z_counter=0 for i in range(1,n+1): if i%3==0 and i%5==0: z_counter = z_counter + 4 elif i%3 == 0: z_counter = z_counter + 2 elif i%5 == 0: z_counter = z_counter + 2 else: pass print(z_counter)