#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
int i,n,m,ans=0,a[100],r[100];
scanf("%d%d",&n,&m);
for(i=0;i<n;i++)scanf("%d",&a[i]);
for(i=0;i<m;i++)scanf("%d",&r[i]);
sort(a,a+n);sort(r,r+m);
int j=0;
for(i=0;i<m;i++){
if(r[i]>=a[j]){j++; ans++;}
if(r[i]>=a[j]){j++; ans++;}
}
printf("%d\n",ans);
return 0;
}