(defn input []
  (vector
    (Integer/parseInt (read-line))
    (->> (clojure.string/split (read-line) #"\s")
      (mapv #(Integer/parseInt %)))))

(defn Thumbnail [[N As]]
  (let [avg (quot (apply + As) (float N))
        tmp (map #(- % avg) As)]
    (->> tmp
      (apply min)
      (.indexOf tmp))))

(->> (input)
  Thumbnail
  println)