# Enter your code here. Read input from STDIN. Print output to STDOUT n = gets.to_i h = {} inp = gets.split(" ").map(&:to_i) inp.each { |j| h[j] = h.fetch(j, 0) + 1 } max = -1 h.keys.each {|i| if i > max max = i end } puts h[max]