#include<iostream>
#include<algorithm>
using namespace std;
int cmp(int a,int b){
return a>b;
}
int n,a[1001],b[1001];
int main(){
while(cin>>n&&n){
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<n;i++)
cin>>b[i];
sort(a,a+n,cmp);
sort(b,b+n,cmp);
int t,ans=0;
/*表示田忌和齐王的最差的马和最好的马*/
int l1=0,l2=0,r1=n-1,r2=n-1;
while(l1<=r1){
if(a[l1]>b[l2]){
ans+=200;
l1++;
l2++;
}
else if(a[l1]<b[l2]){
ans-=200;
r1--;
l2++;
}
else if(a[l1]==b[l2]&&a[r1]>b[r2]){
ans+=200;
r1--;
r2--;
}
else if(a[l1]==b[l2]&&a[r1]<=b[r2]){
if(a[r1]<b[l2]) ans-=200;
r1--;
l2++;
}
}
cout<<ans<<endl;
}
return 0;
}