#include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int a[n],b[m];
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<m;i++){
cin>>b[i];
}
sort(a,a+n);
sort(b,b+m);
int count=0;
int i=n-1,j=m-1;
while(i>=0&&j>=0){
if(a[i]>b[j]){
count++;
i--;j--;
}
else if(a[i]<=b[j]){
j--;
}
}
cout<<count<<endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpewoJaW50IG4sbTsKCWNpbj4+bj4+bTsKCWludCBhW25dLGJbbV07Cglmb3IoaW50IGk9MDtpPG47aSsrKXsKCQljaW4+PmFbaV07Cgl9Cglmb3IoaW50IGk9MDtpPG07aSsrKXsKCQljaW4+PmJbaV07Cgl9Cglzb3J0KGEsYStuKTsKCXNvcnQoYixiK20pOwoJaW50IGNvdW50PTA7CglpbnQgaT1uLTEsaj1tLTE7Cgl3aGlsZShpPj0wJiZqPj0wKXsKCQlpZihhW2ldPmJbal0pewoJCQljb3VudCsrOwoJCQlpLS07ai0tOwoJCX0KCQllbHNlIGlmKGFbaV08PWJbal0pewoJCQlqLS07CgkJfQoJfQoJY291dDw8Y291bnQ8PGVuZGw7CglyZXR1cm4gMDsKfQogICAg