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