#include <cstdio>
using namespace std;
int a[10000]={0},hash[1000000]={0};
int findmin(int a,int b)
{
if (a<b)
return(a);
else
return(b);
}
int main(void)
{
freopen("buyfree.in","r",stdin);
freopen("buyfree.out","w",stdout);
int i,j,c,n1,n2,hashmax=0,temp;
scanf("%d %d\n",&n1,&n2);
c=n1;
for (i=0;i<n1;i++)
scanf("%d\n",&a[i]);
for (i=0;i<n2;i++)
{
scanf("%d\n",&temp);
hash[temp]++;
if (temp>hashmax)
hashmax=temp;
}
for (i=0;i<n1;i++)
{
temp=findmin(a[i]-1,hashmax);
for (j=temp;j>=0;j--)
if (hash[j])
{
c++;
hash[j]--;
if (j==hashmax&&hash[j]==0)
for (j=hashmax-1;j>=0;j--)
if (hash[j])
{
hashmax=j;
break;
}
break;
}
}
printf("%d\n",c);
fclose(stdin);
fclose(stdout);
return(0);
}