gets;p gets.split.map(&:to_i).each_cons(3).count{|a,b,c|c