import Control.Applicative
import Control.Monad
import Data.List
import Data.Ratio
import Data.Ord

solve as = let avg = sum as % length as in snd $ minimum $ flip zip [0..] $ map (abs . subtract avg . (%1)) as

main = getLine >> map read . words <$> getLine >>= print . solve