nu = gets.to_i
fr = gets.chomp.split(" ").map(&:to_i)
sum = 0
for i in 0..nu - 1
  sum += fr[i]
  fr[i] *= nu
end
ans = 0
dis = 100000
for i in 0..nu - 1
  if (sum - fr[i]).abs < dis
    ans = i
    dis = (sum - fr[i]).abs
  end
end
puts ans
