n = gets.to_i k = gets.to_i rank = 1 (n-1).times do |i| if gets.to_i > i rank += 1 end puts rank end