gets p gets.split.map(&:to_i).each_cons(3).filter{|g| g.uniq.size == 3}.size