calcStam :: Int -> [Int] -> Int
calcStam i x = sum $ map (\a -> (a-i) ^ 2) x

main = do
   n <- (read :: String -> Int) <$> getLine
   x <- map (read :: String -> Int) . words <$> getLine
   putStrLn $ show $ minimum $ map (\a -> calcStam a x) [1..100]