#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=110;
ll a[N],b[N];
int n,cnt;
int main () {
freopen("proposal.in","r",stdin);
freopen("proposal.out","w",stdout);
scanf("%d",&n);
for (int i=1;i<=n;i++) scanf("%lld",&a[i]);
for (int i=1;i<=n;i++) scanf("%lld",&b[i]);
sort(a+1,a+n+1);
sort(b+1,b+n+1);
for (int i=1;i<=n;i++) {
if (i+cnt>n) break;
while (a[i]>b[i+cnt]&&i+cnt<=n) cnt++;
}
printf("%d",cnt);
return 0;
}