<Problem>
http://ntucoder.net/Problem/Details/93
uses crt;
var a,b:array[1..100000] of longint;
n,m,i,d,j:longint;
procedure sort(l,r:longint);
var i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=a[(l+r) div 2] ;
repeat
while a[i]<x do inc(i);
while a[j]>x do dec(j);
if not (i>j) then
begin
y:=a[i];
a[i]:=a[j];
a[j]:=y;
inc(i);dec(j);
end;
until i>j;
if l<j then sort(l,j);
if i<r then sort(i,r);
end;
procedure sortb(l,r:longint);
var i,j,x,y:longint;
begin
i:=l;
j:=r;
x:=b[(l+r) div 2] ;
repeat
while b[i]<x do inc(i);
while b[j]>x do dec(j);
if not (i>j) then
begin
y:=b[i];
b[i]:=b[j];
b[j]:=y;
inc(i);dec(j);
end;
until i>j;
if l<j then sortb(l,j);
if i<r then sortb(i,r);
end;
begin
readln(n,m);
for i:=1 to n do read(a[i]);
for j:=1 to m do read(b[j]);
sort(1,n);
sortb(1,m);
i:=n;
j:=m;
d:=0;
while (j>0) and (i>0) do
if a[i]>b[j] then
begin
d:=d+1;
dec(i);dec(j);
end
else dec(j);
write(d);
end.