#!/bin/ruby n = gets.strip.to_i birds = gets.strip.split(' ').map(&:to_i) types = [0] * 6 birds.each {|b| types[b] += 1} max = 0 type = 0 types.each_with_index do |t, i| if t > max type = i max = t end end puts type