gets result = 1 3.times do result *= gets.split(" ").map{|i| i.to_i}.count{|i| i%3!=0} end puts result