N=int(input()) A=N//15*16 B=N%15 count=0 for i in range(B): if i%3==0 or i%5==0: count+=2 print(A+count)