#include<stdio.h> #include<algorithm> #include<cmath> using namespace std; int a[10010],b[10010]; int main() { int n; scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &a[i]); for(int i = 0; i < n; i++) scanf("%d", &b[i]); sort(a, a + n); sort(b, b + n); int ans = 0; int now = 0; for(int i = 0; i < n; i++){ while(a[now] <= b[i] && now < n){ now++; } if(now == n){ break; } ans++; now++; } printf("%d\n", ans); }