#include #define rep(i,n) for(int i=0; i<(int)(n); i++) using namespace std; int main(){ int N; cin >> N; vector a(N), b(N); rep(i,N) cin >> a[i]; rep(i,N) cin >> b[i]; sort(a.begin(),a.end(),greater()); sort(b.begin(),b.end()); int ans=0; rep(i,N) if(a[i]>b[i]) ans+=a[i]-b[i]; cout << ans << endl; return 0; }