n=gets.to_i
a = gets.chomp.split.map(&:to_f)
ave = a.inject(:+) / n

m = Float::INFINITY
ans = 0
a.each_with_index do |v, i|
    if (v - ave).abs < m 
        m = (v - ave).abs
        ans = i
    end
end
puts ans
