gets p 3.times.map{gets.split.count{|e|e.to_i%3>0}}.reduce(:*)