#include<fstream>
using namespace std;
ifstream fin("horsea.in");
ofstream fout("horsea.out");
int a[5002]={0},b[5002]={0};
void sort(int l,int r)
{
int i,j;
int x,y;
i=l;
j=r;
x=a[(l+r)/2];
do
{
while (a[i]<x) i++;
while (a[j]>x) j--;
if (i<=j)
{
y=a[i];
a[i]=a[j];
a[j]=y;
i++;
j--;
}
}
while (i<=j);
if (l<j) sort(l,j);
if (i<r) sort(i,r);
}
void sqort(int l,int r)
{
int i,j;
int x,y;
i=l;
j=r;
x=b[(l+r)/2];
do
{
while (b[i]<x) i++;
while (b[j]>x) j--;
if (i<=j)
{
y=b[i];
b[i]=b[j];
b[j]=y;
i++;
j--;
}
}
while (i<=j);
if (l<j) sort(l,j);
if (i<r) sort(i,r);
}
int main()
{
int i,j,k=0,l=0,x,y;
int n=0,money=0;
fin>>n;
x=n;
y=n;
for (i=1;i<=n;i++)
fin>>a[i];
for (i=1;i<=n;i++)
fin>>b[i];
sort(1,n);
sqort(1,n);
for (i=1;i<=n;i++)
{
if (a[x]>b[y])
{
money--;
a[x]=0;
x--;
for (j=1;j<=y-1;j++)
b[j]=b[j+1];
y--;
}
if (a[x]<b[y])
{
money++;
a[x]=0;
x--;
b[y]=0;
y--;
}
if (a[x]==b[y])
{
a[x]=0;
x--;
for (j=1;j<=y-1;j++)
b[j]=b[j+1];
y--;
}
}
fout<<money<<endl;
fin.close();
fout.close();
return 0;
}