import Data.List

x ? (a,b) = if x then a else b

readInt :: String -> Int
readInt = read

main = do
    getLine
    vs <- map readInt.words<$>getLine
    cs <- map readInt.words<$>getLine
    print $ solve vs cs

solve vs cs = select gain where
  gain = sort $ zipWith (-) vs cs

select [] = 0
select (a:b) = (a>0)?(a,0) + select b 
