def fizzbuzz(n) count = 0 # fizzbuzz (1..n).each do |i| if i % 3 == 0 && i % 5 == 0 count += 4 next elsif i % 3 == 0 || i % 5 == 0 count += 2 next end end count.to_i end input = $stdin.gets.to_i puts fizzbuzz(input)