N = int(input()) # L = [] l = "" for i in range(1, N + 1): if i % 15 == 0: # L.appned("FizzBuzz") l += "FizzBuzz" elif i % 3 == 0: # L.appned("Fizz") l += "Fizz" elif i % 5 == 0: # L.append("Buzz") l += "Buzz" else: l += str(i) # print(l) print(l.count("z"))