input = gets.to_i s = Array.new for num in 1..input do if num % 15 == 0 then out = "FizzBuzz" elsif num % 3 == 0 then out = "Fizz" elsif num % 5 == 0 then out = "Buzz" else out = num end s << out end p s.join.split("").count("z")