#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n,a[100005],b[100005],m,d=0,h=LLONG_MIN;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    freopen("CAU2.INP","r",stdin);
    freopen("CAU2.OUT","w",stdout);
    cin>>n>>m;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i];
        h=max(h,a[i]);
    }
    for (int i=1;i<=m;i++)
        cin>>b[i];
    sort (a+1,a+n+1);
    sort (b+1,b+m+1);
    if (b[1]>=a[n])
    {
        cout<<0;
        return 0;
    }
    for (int i=1;i<=n;i++)
    {
        for (int j=1;j<=m;j++)
        {
            if (a[i]>b[j])
            {

                d++;
                b[j]=h;
                j=m;
            }
            else if (a[i]<=b[j]&&b[j]!=h)
                j=m;
        }
    }
    cout<<d;
    return 0;
}
