N = gets.to_i
A = gets.split.map(&:to_i)

ave = A.inject(:+) / N.to_f

ans = 0
minf = Float::INFINITY

A.each_with_index do |a, i|
  abs = (ave - a).abs

  if minf > abs
    minf = abs
    ans = i
  end
end

puts ans
