import Data.List

solver::Int -> [Int]->[Int]->Int
solver n vs cs = (sum.(takeWhile (0<)).(take n).(sortBy (\ x -> \ y -> compare y x)).(map (\ (v,c) -> v-c))) (zip vs cs)



main::IO()
main=do
  n<-return.read=<<getLine
  vs<-return.map read.words=<<getLine
  cs<-return.map read.words=<<getLine
  print (solver n vs cs)
