module Main where

import Control.Applicative
import Control.Monad
import Data.List

take2 []       = []
take2 [x]      = [x]
take2 (x:y:ys) = x : take2 ys

main :: IO ()
main = do
    getLine
    as <- sortBy (\a b -> b `compare` a)
        . fmap read . words <$> getLine :: IO [Int]
    let alice = take2 as
    let bob   = take2 (tail as)
    print $ sum alice - sum bob