N = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_f)
mean = a.inject(:+) / N

b = a.map{|x| (x - mean).abs}

bmin = b.max
ans = 0

b.each_with_index do |x, i|
  if x < bmin
    bmin = x
    ans = i
  end
end
puts ans 