n=int(input()) s="" index=-1 cnt=0 for i in range(1,n+1): if i%3==0 and i%5==0: s+="FizzBuzz" elif i%3==0: s+="Fizz" elif i%5==0: s+="Buzz" else: s+=str(i) while True: index=s.find("z",index+1) if index==-1: break else: cnt+=1 print(cnt)