T=[i+1 for i in range(15)] for i in range(15): k=i+1 if k%15==0: T[i]="Fizz Buzz" elif k%3==0: T[i]="Fizz" elif k%5==0: T[i]="Buzz" else: T[i]=str(k) U=[0] X=0 for i in range(15): X+=T[i].count("z") U.append(X) N=int(input()) Q,R=divmod(N,15) print(Q*U[-1]+U[R])