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