n = gets.to_i a = $<.map(&:to_i) y = 1 p y 1.upto(n - 1) do |i| if a[0] < a[i] y += 1 end p y end