N = gets.to_i count = Array.new(7,0) L = gets.chomp.split N.times do |i| count[L[i].to_i] += 1 end max = -1 output = -1 for i in 1..6 if count[i] >= max output = i; max = count[i] end end puts output