def fizzbuzz(n) if n % 15 == 0 "FizzBuzz" elsif n % 3 == 0 "Fizz" elsif n % 3 == 0 "Buzz" else n.to_s end end N = gets.to_i puts N.times.map { fizzbuzz(_1) }.join.count("z")