N = int(input()) s = 0 for i in range(1,N+1): if i%15 == 0: s+=4 elif i%5 ==0 or i%3 == 0: s+=2 print(s)