#include <algorithm>
#include <bitset>
#include <deque>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <iomanip>
#include <vector>

#define fst first
#define snd second
#define all(x) (x).begin(), (x).end()
#define clr(a, v) memset( a , v , sizeof(a) )
#define pb push_back
#define mp make_pair
#define sz size()
#define FORN( i , s , n ) for( int i = (s) ; i < (n) ; i++ )
#define FOR( i , n ) FORN( i , 0 , n )
#define FORIT( i , x ) for( typeof x.begin() i = x.begin() ; i != x.end() ; i++ )
#define trace(x)    cout << #x << ": " << x << endl;
#define trace2(x, y) cout << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z) cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define read ios::sync_with_stdio(false)

using namespace std;

typedef long long int64;
typedef vector <int> vi;
typedef pair <int64,int64> ii;
typedef vector <string> vs;
typedef vector <ii> vii;

int64 cnt[32];
int64 esp[32];
map<int64,int64> mapa;

int main(){
    //read;
    int64 N,M,W;
    cin>>N>>M;

    int val;
    FOR(i,N) {
        scanf ( "%d ",&val );
        int j = 0;
        while( val ){
            if ( val&1 ) esp[j]++;
            j++;val/=2;
        }
    }

    vi B(M);

    FOR(i,M) scanf("%d",&B[i]);

    int64 cont = 0;

    sort(all(B));

    FOR(i,M){
            int64 nxt = B[i];

            while ( nxt<31 and !esp[nxt] ) esp[nxt++]=1;
            if ( nxt==31 ) {
                cout<<i<<endl;
                return 0;
            }
            esp[nxt]--;
    }
    cout<<M<<endl;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];

bool isval(int x){
	priority_queue <int> s;
	for(int i = 0; i < n; ++i) s.push(a[i]);
	for(int i = x; i --;){
		int y = s.top();
		s.pop();
		y -= 1 << b[i];
		if(y < 0) return false;
		s.push(y);
	}
	return true;
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	for(int i = 0; i < n; ++i) cin >> a[i];
	for(int i = 0; i < m; ++i) cin >> b[i];
	sort(b, b + m);
	int down = 0, up = m + 1;
	while(up - down > 1){
		int mid = (down + up) / 2;
		if(isval(mid))
			down = mid;
		else
			up = mid;
	}
	cout << down << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];

priority_queue <int> s;

inline bool isval(int x){
	while(SZ(s)) s.pop();
	for(int i = 0; i < n; ++i) s.push(a[i]);
	for(int i = x; i --;){
		int y = s.top();
		s.pop();
		y -= 1 << b[i];
		if(y < 0) return false;
		s.push(y);
	}
	return true;
}

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i) scanf("%d", a + i);
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(b, b + m);
	int down = 0, up = m + 1;
	while(up - down > 1){
		int mid = (down + up) / 2;
		if(isval(mid))
			down = mid;
		else
			up = mid;
	}
	cout << down << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];
int c[33];

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i){
		scanf("%d", a + i);
		for(int j = 0; j < 32; ++j)
			if((a[i] >> j) & 1)
				c[j] ++;
	}
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(b, b + m);
	int ans;
	for(ans = 0; ans < m; ++ans){
		for(int i = 0; i < 5; ++i)
			cerr << c[i] << " ";
		cerr << "\n";
		if(c[b[ans]]){
			c[b[ans]] --;
			continue;
		}
		int x;
		for(x = b[ans]; x < 32; ++x)
			if(c[x]) break;
		while(x != b[ans] && c[x]){
			c[x] --;
			x --;
			c[x] += 2;
		}
		if(c[b[ans]])
			c[b[ans]] --;
		else
			break;

	}
	cout << ans << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];

inline bool isval(int x){
	priority_queue <int> s;
	for(int i = 0; i < n; ++i) s.push(a[i]);
	for(int i = x; i --;){
		int y = s.top();
		s.pop();
		y -= 1 << b[i];
		if(y < 0) return false;
		s.push(y);
	}
	return true;
}

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i) scanf("%d", a + i);
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(b, b + m);
	int down = 0, up = m + 1;
	while(up - down > 1){
		int mid = (down + up) / 2;
		if(isval(mid))
			down = mid;
		else
			up = mid;
	}
	cout << down << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];

bool isval(int x){
	priority_queue <int> s;
	for(int i = 0; i < n; ++i) s.push(a[i]);
	for(int i = x; i --;){
		int y = s.top();
		s.pop();
		y -= 1 << b[i];
		if(y < 0) return false;
		s.push(y);
	}
	return true;
}

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i) scanf("%d", a + i);
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(b, b + m);
	int down = 0, up = m + 1;
	while(up - down > 1){
		int mid = (down + up) / 2;
		if(isval(mid))
			down = mid;
		else
			up = mid;
	}
	cout << down << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];
int c[32];

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i){
		scanf("%d", a + i);
		for(int j = 0; j < 32; ++j)
			if((a[i] >> j) & 1)
				c[j] ++;
	}
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(b, b + m);
	int ans;
	for(ans = 0; ans < m; ++ans){
		if(c[b[ans]]){
			c[b[ans]] --;
			continue;
		}
		int x;
		for(x = b[ans]; x < 32; ++x)
			if(c[x]) break;
		while(x != b[ans] && c[x]){
			c[x] --;
			c[x - 1] += 2;
			x --;
		}
		if(c[b[ans]])
			c[b[ans]] --;
		else
			break;

	}
	cout << ans << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];
int c[33];

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i){
		scanf("%d", a + i);
		for(int j = 0; j < 32; ++j)
			if((a[i] >> j) & 1)
				c[j] ++;
	}
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(b, b + m);
	int ans;
	for(ans = 0; ans < m; ++ans){
		if(c[b[ans]]){
			c[b[ans]] --;
			continue;
		}
		int x;
		for(x = b[ans]; x < 32; ++x)
			if(c[x]) break;
		while(x != b[ans] && c[x]){
			c[x] --;
			x --;
			c[x] += 2;
		}
		if(c[b[ans]])
			c[b[ans]] --;
		else
			break;

	}
	cout << ans << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];
int c[32];

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i){
		scanf("%d", a + i);
		for(int j = 0; j < 32; ++j)
			if((a[i] >> j) & 1)
				c[j] ++;
	}
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(b, b + m);
	int ans;
	for(ans = 0; ans < m; ++ans){
		if(c[b[ans]]){
			c[b[ans]] --;
			continue;
		}
		int x;
		for(x = b[ans]; x < 32; ++x)
			if(c[x]) break;
		while(x != b[ans] && c[x]){
			c[x] --;
			c[x - 1] += 2;
		}
		if(c[b[ans]])
			c[b[ans]] --;
		else
			break;
	}
	cout << ans << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];
multiset <int> s;

bool isval(int x){
	s.clear();
	for(int i = 0; i < n; ++i) s.insert(a[i]);
	for(int i = x; i --;){
		auto it = s.rbegin();
		int y = *it;
		s.erase(s.find(y));
		y -= 1 << b[i];
		if(y < 0) return false;
		s.insert(y);
	}
	return true;
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> m;
	for(int i = 0; i < n; ++i) cin >> a[i];
	for(int i = 0; i < m; ++i) cin >> b[i];
	sort(b, b + m);
	int down = 0, up = m + 1;
	while(up - down > 1){
		int mid = (down + up) / 2;
		if(isval(mid))
			down = mid;
		else
			up = mid;
	}
	cout << down << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];

priority_queue <int> s;

inline bool isval(int x){
	while(SZ(s)) s.pop();
	for(int i = 0; i < x; ++i) s.push(a[i]);
	for(int i = x; i --;){
		int y = s.top();
		s.pop();
		y -= 1 << b[i];
		if(y < 0) return false;
		s.push(y);
	}
	return true;
}

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i) scanf("%d", a + i);
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(a, a + n);
	reverse(a, a + n);
	sort(b, b + m);
	int down = 0, up = m + 1;
	while(up - down > 1){
		int mid = (down + up) / 2;
		if(isval(mid))
			down = mid;
		else
			up = mid;
	}
	cout << down << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];
int c[32];

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i){
		scanf("%d", a + i);
		for(int j = 0; j < 32; ++j)
			if((a[i] >> j) & 1)
				c[j] ++;
	}
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(b, b + m);
	int ans;
	for(ans = 0; ans < m; ++ans){
		if(c[b[ans]]){
			c[b[ans]] --;
			continue;
		}
		int x;
		for(x = b[ans]; x < 32; ++x)
			if(c[x]) break;
		while(x != b[ans] && c[x]){
			c[x] --;
			x --;
			c[x] += 2;
		}
		if(c[b[ans]])
			c[b[ans]] --;
		else
			break;

	}
	cout << ans << "\n";
	return 0;
}


//#include <bits/stdc++.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <algorithm>
#include <deque>
#include <queue>
#include <ctime>
#include <iomanip>
#include <cstring>

#define SZ(x) ((int)x.size())
#define X first
#define Y second
#define PB push_back
#define MP make_pair

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;

const int N = 1000 * 1000 + 100;

int n, m;
int a[N], b[N];

priority_queue <int> s;

inline bool isval(int x){
	while(SZ(s)) s.pop();
	for(int i = 0; i < min(x, n); ++i) s.push(a[i]);
	for(int i = x; i --;){
		int y = s.top();
		s.pop();
		y -= 1 << b[i];
		if(y < 0) return false;
		if(y >= a[min(x, n - 1)])
			s.push(y);
	}
	return true;
}

int main(){
	cin >> n >> m;
	for(int i = 0; i < n; ++i) scanf("%d", a + i);
	for(int i = 0; i < m; ++i) scanf("%d", b + i);
	sort(a, a + n);
	reverse(a, a + n);
	sort(b, b + m);
	int down = 0, up = m + 1;
	while(up - down > 1){
		int mid = (down + up) / 2;
		if(isval(mid))
			down = mid;
		else
			up = mid;
	}
	cout << down << "\n";
	return 0;
}


/*----------------by syr----------------*/
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<deque>
#include<fstream>
#include<functional>
#include<iomanip>
#include<iostream>
#include<limits>
#include<list>
#include<map>
#include<math.h>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<sstream>
#include<string>
#include<time.h>
#include<utility>
#include<vector>

using namespace std;

const int INF=1e9+7;

int n,m;
long long a[1000005],b[1000005],cnt[35],cnt2[35],cnt3[35];

bool check(int md){
//	printf("%d\n",md);
	memset(cnt3,0,sizeof(cnt3));
	memset(cnt2,0,sizeof(cnt2));
	for(int i=0;i<md;i++){
		cnt2[b[i]]++;
	}
	for(int i=0;i<32;i++) cnt3[i]=cnt[i];
//	for(int i=0;i<5;i++) printf("%d ",cnt[i]);
//	puts("");
//	for(int i=0;i<5;i++) printf("%d ",cnt2[i]);
//	puts("");
	for(int i=31;i>=0;i--){
		if(cnt2[i]>cnt3[i]){
//			printf("i=%d\n",i);
			return false;
		}
		cnt3[i]-=cnt2[i];
		if(i>0) cnt3[i-1]+=cnt3[i]*2;
//		for(int j=0;j<5;j++) printf("%d ",cnt[j]);
//		puts("");
	}
	return true;
}

int main(){
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++) scanf("%I64d",a+i);
	sort(a,a+n);
	for(int i=0;i<n;i++){
		for(int j=0;j<32;j++){
			if(a[i]&(1<<j)){
				cnt[j]++;
			}
		}
	}
	for(int i=0;i<m;i++) scanf("%I64d",b+i);
	sort(b,b+m);
	long long lb=0,rb=m+1;
	while(lb+1<rb){
		int md=(lb+rb)>>1;
		if(check(md)) lb=md;
		else rb=md;
	}
	printf("%I64d\n",lb);
	return 0;
}


#include <bits/stdc++.h>

#define FOR(i,a,b) for( ll i = (a); i < (ll)(b); i++ )
#define REP(i,n) FOR(i,0,n)
#define YYS(x,arr) for(auto& x:arr)
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort( (x).begin(),(x).end() )
#define REVERSE(x) reverse( (x).begin(),(x).end() )
#define UNIQUE(x) (x).erase( unique( ALL( (x) ) ) , (x).end() )
#define PW(x) (1LL<<(x))
#define SZ(x) ((ll)(x).size())

#define pb emplace_back
#define fi first
#define se second

using namespace std;

typedef long double ld;
typedef long long int ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<ld> vd;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<vpl> gr;
typedef vector<vl> ml;
typedef vector<vd> md;
typedef vector<vi> mi;

const ll INF = (ll)1e9 + 10;
const ll INFLL = (ll)1e18 + 10;
const ld EPS = 1e-10;
const ll MOD = 1e9+7;

template<class T> T &chmin( T &a , const T &b ){ return a = min(a,b); }
template<class T> T &chmax( T &a , const T &b ){ return a = max(a,b); }

template<class T> inline T sq( T a ){ return a * a; }

// head

const int MAX_N = 1000010;

int n, m;
int a[MAX_N], b[MAX_N], c[MAX_N];

int ans = 0;

int main(){

  scanf( "%d %d" , &n , &m );
  REP( i , n ){
    scanf( "%d" , &a[i] );
    REP( j , 31 ) if( a[i] & PW(j) ) c[j]++;
  }

  REP( i , m ) scanf( "%d" , &b[i] );
  sort( b , b+m );

  REP( i , m ){
    FOR( j , b[i] , 31 ) if( c[j] ){
      c[j]--;
      FOR( k , b[i] , j ) c[k]++;
      ans++;
      break;
    }
  }

  printf( "%d\n" , ans );

  return 0;
}


#include <stdio.h>
int main()
{
	int n,m;
	scanf("%d %d",&n,&m);
	int a[n],b[m];
	for(int i = 0;i<n;i++)
		scanf("%d",a+i);
	for(int i = 0;i<m;i++)
		scanf("%d",b+i);

	int i = 0;
	int j = 0;
	int req = n;
	while(i < n && j < m)
	{
		while(b[j] < a[i] && j < m)
			j++;
		if(b[j] >= a[i])
			req--;
		i++;j++;
	}

	printf("%d",req);
	return 0;
}


#include<stdio.h>

int main()
{
    int n,m,z=0;
    scanf("%d%d",&n,&m);
    int ar[n],br[m],cr[m],cnt=0;
    for(int i=0;i<n;i++)
    scanf("%d",&ar[i]);
    for(int i=0;i<m;i++)
    scanf("%d",&br[i]);
    for(int i=0;i<m;i++)
    {
    if(br[i]!=br[i+1])
    cr[z++]=br[i];
    }
    m=z;
    z=0;
    int k=0;
    while(k<n&&z<m)
    {
    if(cr[z]>ar[k])
    {
    k++;
    cnt++;
    }
    else if(cr[z]==ar[k])
    {
    z++;
    k++;
    }
    else
    z++;
    }
    if(k<n&&z==m)
    printf("%d", cnt+(n-k));
    else
    printf("%d",cnt);
    return 0;
}


#include<stdio.h>

int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    int ar[n],br[m],a=0,b=0;
    for(int i=0;i<n;i++)
    {
    scanf("%d",&ar[i]);
    }
    for(int i=0;i<m;i++)
    {
    scanf("%d",&br[i]);
    }
    int cnt=0;
    while(a<n&&b<m)
    {
    if(ar[a]==br[b])
    {
    a++;
    b++;
    }
    else if(ar[a]>br[b])
    {
    b++;
    }
    else
    {
    a++;
    b++;
    }
    }
    cnt=n-a;
    printf("%d",cnt);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>

int v1[3000 ];

int main(){
  int n, m, i, j, rez, x;
  scanf( "%d%d", &n, &m );
  for ( i = 0; i < n; i ++ ){
    scanf( "%d", &v1[i] );
  }
  i = 0;
  for ( j = 0; j < m; j ++ ){
    scanf( "%d", &x );
    if ( i < n && x >= v1[i] ){
      i ++;
    }
  }
  printf( "%d", n - i );
  return 0;
}


#include <stdio.h>
int main()
{
    int n,m;int cnt=0;
    scanf("%d%d",&n,&m);
    int a[n];int b[m];
    for(int i=0;i<n;i++)
    scanf("%d",&a[i]);
    for(int i=0;i<m;i++)
    {
    scanf("%d",&b[i]);
        for(int j=0;j<n;j++)
        {
            if(a[j]==b[i])
            {
                a[j]=-1;
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        if(a[i]!=-1)
        cnt++;
    }
    printf("%d",cnt);
}


// Make a Snippet for the code above this and then write your logic in main()
function main() {
  const input = readline().split(' ').map(Number)
  const [goodRoundProblems, preparedProblems] = input
  const goodComplexities = readline().split(' ').map(Number)
  const preparedComplexities = readline().split(' ').map(Number)
  helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities)
}

function helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities) {
  let cnt = 0
  let j = 0
  for (let i = 0; i < goodRoundProblems; i++) {
    const goodComplexity = goodRoundProblems[i]
    while (goodComplexity > preparedComplexities[j]){
      j++
    }
    if (j === preparedProblems - 1) {
      console.log((goodRoundProblems - i - 1) + '')
      return
    }
  }
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  const input = readline().split(' ').map(Number)
  const [goodRoundProblems, preparedProblems] = input
  const goodComplexities = readline().split(' ').map(Number)
  const preparedComplexities = readline().split(' ').map(Number)
  helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities)
}

function helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities) {
  let cnt = new Map()
  for (let i = 0; i < goodRoundProblems; i++) {
    cnt.set(goodComplexities[i], (cnt.get(goodComplexities[i]) || 0) + 1)
  }

  for (let i = 0; i < preparedProblems; i++) {
    const complexity = preparedComplexities[i]
    if (cnt.has(complexity)) {
      cnt.set(complexity, cnt.get(complexity) - 1)
      if (cnt.get(complexity) === 0) {
        cnt.delete(complexity)
      }
    }
  }

  let missed = 0
  for (let value of cnt.values()) {
    missed += value
  }

  console.log(missed)
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  const input = readline().split(' ').map(Number)
  const [goodRoundProblems, preparedProblems] = input
  const goodComplexities = readline().split(' ').map(Number)
  const preparedComplexities = readline().split(' ').map(Number)
  helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities)
}

function helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities) {
    let cnt = 0
    let j = 0
    for (let i = 0; i < goodRoundProblems; i++) {
        while (j < preparedProblems) {
            if (preparedComplexities[j] >= goodComplexities[i]) {
                cnt++
                i++
            }
            j++
        }
    }

    console.log(Math.max(0, goodRoundProblems - cnt))
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  const input = readline().split(' ').map(Number)
  const [goodRoundProblems, preparedProblems] = input
  const goodComplexities = readline().split(' ').map(Number)
  const preparedComplexities = readline().split(' ').map(Number)
  helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities)
}

function helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities) {
    let cnt = 0
    let j = 0
    for (let i = 0; i < goodRoundProblems; i++) {
        const goodComplexity = goodComplexities[i]
        if (preparedComplexities[j] >= goodComplexity) {
            j++
            cnt++
        } else {
            while (preparedComplexities[j] && preparedComplexities[j] < goodComplexity) {
                j++
            }
            if (preparedComplexities[j] && preparedComplexities[j] >= goodComplexity)
                cnt++
        }
        if (j === preparedProblems - 1) {
            console.log(goodRoundProblems - cnt - 1)
            return
        }
    }

    console.log(goodRoundProblems - cnt)
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  const input = readline().split(' ').map(Number)
  const [goodRoundProblems, preparedProblems] = input
  const goodComplexities = readline().split(' ').map(Number)
  const preparedComplexities = readline().split(' ').map(Number)
  helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities)
}

function helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities) {
    let cnt = 0
    let j = 0
    for (let i = 0; i < goodRoundProblems; i++) {
        while (j < m) {
            if (preparedComplexities[j] >= goodComplexities[i]) {
                cnt++
                i++
            }
            j++
        }
    }

    console.log(Math.max(0, goodRoundProblems - cnt))
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  const input = readline().split(' ').map(Number)
  const [goodRoundProblems, preparedProblems] = input
  const goodComplexities = readline().split(' ').map(Number)
  const preparedComplexities = readline().split(' ').map(Number)
  helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities)
}

function helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities) {
    let cnt = 0
    let j = 0
    for (let i = 0; i < goodRoundProblems; i++) {
        const goodComplexity = goodComplexities[i]
        if (preparedComplexities[j] >= goodComplexity) {
            j++
            cnt++
        } else {
            while (preparedComplexities[j] && preparedComplexities[j] < goodComplexity) {
                j++
            }
            if (preparedComplexities[j] && preparedComplexities[j] >= goodComplexity)
                cnt++
        }
        if (cnt === goodRoundProblems - 1) {
           console.log(0)
           return
        }

        if (j >= preparedProblems - 1) {
            console.log(goodRoundProblems - cnt)
            return
        }
    }
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  const input = readline().split(' ').map(Number)
  const [goodRoundProblems, preparedProblems] = input
  const goodComplexities = readline().split(' ').map(Number)
  const preparedComplexities = readline().split(' ').map(Number)
  helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities)
}

function helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities) {
    let cnt = 0
    let j = 0
    for (let i = 0; i < goodRoundProblems; i++) {
        const goodComplexity = goodComplexities[i]
        if (preparedComplexities[j] >= goodComplexity) {
            j++
            cnt++
        } else {
            while (preparedComplexities[j] && preparedComplexities[j] < goodComplexity) {
                j++
            }
            if (preparedComplexities[j] && preparedComplexities[j] >= goodComplexity)
                cnt++
        }
        if (j === preparedProblems) {
            break
        }
    }

    console.log(goodRoundProblems - cnt)
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', (inputStdin) => {
  inputString += inputStdin;
});

process.stdin.on('end', (_) => {
  inputString = inputString
    .trim()
    .split('\n')
    .map((string) => {
      return string.trim();
    });

  main();
});

function readline() {
  return inputString[currentLine++];
}

// Make a Snippet for the code above this and then write your logic in main()
function main() {
  const input = readline().split(' ').map(Number)
  const [goodRoundProblems, preparedProblems] = input
  const goodComplexities = readline().split(' ').map(Number)
  const preparedComplexities = readline().split(' ').map(Number)
  helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities)
}

function helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities) {
    let cnt = 0
    let j = 0
    for (let i = 0; i < goodRoundProblems; i++) {
        const goodComplexity = goodComplexities[i]
        if (preparedComplexities[j] >= goodComplexity) {
            j++
            cnt++
        } else {
            while (preparedComplexities[j] && preparedComplexities[j] < goodComplexity) {
                j++
            }
            if (j < preparedProblems)
                cnt++
        }
        if (j === preparedProblems) {
            break;
        }
    }

    console.log(goodRoundProblems - cnt)
}


// Make a Snippet for the code above this and then write your logic in main()
function main() {
  const input = readline().split(' ').map(Number)
  const [goodRoundProblems, preparedProblems] = input
  const goodComplexities = readline().split(' ').map(Number)
  const preparedComplexities = readline().split(' ').map(Number)
  helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities)
}

function helper(goodRoundProblems, preparedProblems, goodComplexities, preparedComplexities) {
  let cnt = 0
  let j = 0
  for (let i = 0; i < goodRoundProblems; i++) {
    const goodComplexity = goodRoundProblems[i]
    while (goodComplexity > preparedComplexities[j]){
      j++
    }
    if (j === preparedProblems - 1) {
      console.log(goodRoundProblems - i - 1)
      return
    }
  }
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function printResult(x) {
    process.stdout.write(x);
}

function main() {
    const nm = readLine().split(' ').map(Number);
    const requirements = `0 ${readLine()}`.split(' ').map(Number);
    const complexities = `0 ${readLine()}`.split(' ').map(Number);

    const n = nm[0];
    const m = nm[1];

    // console.log(nm, requirements, complexities)
    const result = georgeAndRound(n, m, requirements, complexities);
    printResult(result.toString());
}

const georgeAndRound = (n, m, a, b) => {
    const counts = new Array(Math.pow(10, 6) + 1);
    for (let i = 1; i <= m; i++) counts[b[i]] = 1;
    let appearance = 0;
    for (let i = 1; i <= n; i++) {
        if (counts[a[i]]) appearance++;
    }

    return n - appearance;
};


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function printResult(x) {
    process.stdout.write(x);
}

function main() {
    const nm = readLine().split(' ').map(Number);
    const requirements = readLine().split(' ').map(Number);
    const complexities = readLine().split(' ').map(Number);

    const n = nm[0];
    const m = nm[1];

    // console.log(nm, requirements, complexities)
    const result = georgeAndRound(n, m, requirements, complexities);
    printResult(result.toString());
}

const georgeAndRound = (n, m, a, b) => {
    const counts = new Array(Math.pow(10, 6) + 1);
    for (let i = 0; i < m; i++) {
        counts[b[i]] = 1;
    }
    let appearance = 0;
    for (let i = 0; i < n; i++) {
        if (counts[a[i]]) appearance++;
    }

    return n - appearance;
};


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function printResult(x) {
    process.stdout.write(x);
}

function main() {
    const nm = readLine().split(' ').map(Number);
    const requirements = readLine().split(' ').map(Number);
    const complexities = readLine().split(' ').map(Number);

    const n = nm[0];
    const m = nm[1];

    // console.log(nm, requirements, complexities)
    const result = georgeAndRound(n, m, requirements, complexities);
    printResult(result.toString());
}

const georgeAndRound = (n, m, a, b) => {
    let appearance = 0;
    for (let i = 0; i < n; i++) {
        for (let j = 0; j < m; j++) {
            if (b[j] >= a[i]) {
                appearance++;
                i++;
            }
        }
    }

    return Math.max(0, n - appearance);
};


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readLine() {
    return inputString[currentLine++];
}

function printResult(x) {
    process.stdout.write(x);
}

function main() {
    const nm = readLine().split(' ').map(Number);
    const requirements = readLine().split(' ').map(Number);
    const complexities = readLine().split(' ').map(Number);

    const n = nm[0];
    const m = nm[1];

    // console.log(nm, requirements, complexities)
    const result = georgeAndRound2(n, m, requirements, complexities);
    printResult(result.toString());
}

const georgeAndRound = (n, m, a, b) => {
    let appearance = 0;
    for (let i = 0; i < n; i++) {
        for (let j = 0; j < m; j++) {
            if (b[j] >= a[i]) {
                appearance++;
                i++;
            }
        }
    }

    return Math.max(0, n - appearance);
};

const georgeAndRound2 = (n, m, a, b) => {
    let appearance = 0;
    let j = 0;
    for (let i = 0; i < n; i++) {
        while(j < m) {
            if (b[j] >= a[i]) {
                appearance++;
                i++;
            }
            j++;
        }
    }

    return Math.max(0, n - appearance);
};


using System;

class Program
{
	static void Main(string[] args)
	{
		var input = Array.ConvertAll(Console.ReadLine().Split(' '), x => int.Parse(x));

		var m = input[0];
		var n = input[1];
		var a = Array.ConvertAll(Console.ReadLine().Split(' '), x => int.Parse(x));
		var b = Array.ConvertAll(Console.ReadLine().Split(' '), x => int.Parse(x));

		var k = 0;
		int i = a.Length - 1;
		int j = b.Length - 1;
		for (; i > -1 && j > -1; i--)
		{
			if (a[i] <= b[j])
			{
				j--;
			}
			else
			{
				k++;
			}
		}
		if (i != -1)
		{
			k += i + 1;
		}
		Console.WriteLine(k);
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();

            int n = int.Parse(s.Split()[0]);
            int m = int.Parse(s.Split()[1]);
            int i = 0;

            string[] s2 = Console.ReadLine().Split();
            int[] a = new int[n];
            for (i = 0; i < n; i++)
                a[i] = int.Parse(s2[i]);

            s2 = Console.ReadLine().Split();
            int[] b = new int[m];
            for (i = 0; i < m; i++)
                b[i] = int.Parse(s2[i]);

            int count = 0;
            int j = m - 1;
            for (i = n - 1; i >= 0; i--)
            {
                if (j < 0)
                    break;

                if (a[i] <= b[j])
                    j--;
                else
                    count++;
            }

            count += i + 1;

            Console.WriteLine(count);

        }
    }
}


using System;
class Program
    {
        static void Main(string[] args)
        {
            string [] input = Console.In.ReadToEnd().Split(new char[] { '\n', '\r', ' ', '\t'}, StringSplitOptions.RemoveEmptyEntries);
            int answer=0;
            {
                int j = int.Parse(input[0])+1;
                for (int i = input.Length - 1, lim = j, bgA = int.Parse(input[j]), bgB = int.Parse(input[i]); i > lim && j > 1;)
                {
                    if (bgA > bgB) answer++;
                    else bgB = int.Parse(input[--i]);
                    bgA = int.Parse(input[--j]);
                }
                answer += j - 1;
            }
            Console.WriteLine(answer);
        }
    }


using System;
using System.Linq;
using System.Collections.Generic;

static class UtilityMethods
{
	public static void Swap<T>(ref T a, ref T b)
	{
		T t = a;
		a = b;
		b = t;
	}

	public static int StrToInt(string s)
	{
		int number = 0;
		for (int i = s[0] == '-' ? 1 : 0; i < s.Length; i++)
			number = number * 10 + (s[i] - '0');
		return s[0] == '-' ? -number : number;
	}
	public static long StrToLong(string s)
	{
		long number = 0;
		for (int i = s[0] == '-' ? 1 : 0; i < s.Length; i++)
			number = number * 10 + (s[i] - '0');
		return s[0] == '-' ? -number : number;
	}

	public static string ReadString() => Console.ReadLine();
	public static int ReadInt() => StrToInt(ReadString());
	public static long ReadLong() => StrToLong(ReadString());
	public static double ReadDouble() => double.Parse(ReadString());

	public static string[] ReadStringArray() => ReadString().Split();
	public static int[] ReadIntArray() => Array.ConvertAll(ReadStringArray(), StrToInt);
	public static long[] ReadLongArray() => Array.ConvertAll(ReadStringArray(), StrToLong);
	public static double[] ReadDoubleArray() => ReadStringArray().Select(double.Parse).ToArray();

	public static void WriteLine(object a) => Console.WriteLine(a);
	public static void WriteLineArray<T>(string separator, T[] a, int startIndex, int count)
	{
		const int MAXLEN = 1000000;
		int len = 0, j = startIndex, lastIndex = startIndex + count;
		System.Text.StringBuilder str;
		string[] b = Array.ConvertAll(a, x => x.ToString());
		for (int i = startIndex; i < lastIndex - 1; i++)
		{
			len += b[i].Length + separator.Length;
			if (len >= MAXLEN)
			{
				str = new System.Text.StringBuilder(len);
				for (; j <= i; j++)
				{
					str.Append(b[j]);
					str.Append(separator);
				}
				Console.Write(str);
				len = 0;
			}
		}
		str = new System.Text.StringBuilder(len);
		for (; j < lastIndex - 1; j++)
		{
			str.Append(b[j]);
			str.Append(separator);
		}
		Console.Write(str);
		Console.WriteLine(b.Last());
	}
}

class Program
{
	static void Main()
	{
		int[] data = UtilityMethods.ReadIntArray();
		int n = data[0], m = data[1], ans = 0;
		int[] a = UtilityMethods.ReadIntArray(), b = UtilityMethods.ReadIntArray();
		for (int i = 0, j = 0; i < n; i++)
		{
			for (; j < m && b[j] < a[i]; j++) ;
			if (j == m)
				ans++;
		}
		UtilityMethods.WriteLine(ans);
		Console.ReadLine();
	}
}


using System;
using System.Linq;
using System.Collections.Generic;

static class UtilityMethods
{
	public static void Swap<T>(ref T a, ref T b)
	{
		T t = a;
		a = b;
		b = t;
	}

	public static int StrToInt(string s)
	{
		int number = 0;
		for (int i = s[0] == '-' ? 1 : 0; i < s.Length; i++)
			number = number * 10 + (s[i] - '0');
		return s[0] == '-' ? -number : number;
	}
	public static long StrToLong(string s)
	{
		long number = 0;
		for (int i = s[0] == '-' ? 1 : 0; i < s.Length; i++)
			number = number * 10 + (s[i] - '0');
		return s[0] == '-' ? -number : number;
	}

	public static string ReadString() => Console.ReadLine();
	public static int ReadInt() => StrToInt(ReadString());
	public static long ReadLong() => StrToLong(ReadString());
	public static double ReadDouble() => double.Parse(ReadString());

	public static string[] ReadStringArray() => ReadString().Split();
	public static int[] ReadIntArray() => Array.ConvertAll(ReadStringArray(), StrToInt);
	public static long[] ReadLongArray() => Array.ConvertAll(ReadStringArray(), StrToLong);
	public static double[] ReadDoubleArray() => ReadStringArray().Select(double.Parse).ToArray();

	public static void WriteLine(object a) => Console.WriteLine(a);
	public static void WriteLineArray<T>(string separator, T[] a, int startIndex, int count)
	{
		const int MAXLEN = 1000000;
		int len = 0, j = startIndex, lastIndex = startIndex + count;
		System.Text.StringBuilder str;
		string[] b = Array.ConvertAll(a, x => x.ToString());
		for (int i = startIndex; i < lastIndex - 1; i++)
		{
			len += b[i].Length + separator.Length;
			if (len >= MAXLEN)
			{
				str = new System.Text.StringBuilder(len);
				for (; j <= i; j++)
				{
					str.Append(b[j]);
					str.Append(separator);
				}
				Console.Write(str);
				len = 0;
			}
		}
		str = new System.Text.StringBuilder(len);
		for (; j < lastIndex - 1; j++)
		{
			str.Append(b[j]);
			str.Append(separator);
		}
		Console.Write(str);
		Console.WriteLine(b.Last());
	}
}

class Program
{
	static void Main()
	{
		int[] data = UtilityMethods.ReadIntArray();
		int n = data[0], m = data[1], ans = 0;
		int[] a = UtilityMethods.ReadIntArray(), b = UtilityMethods.ReadIntArray();
		for (int i = 0, j = 0; i < n; i++, j++)
		{
			for (; j < m && b[j] < a[i]; j++) ;
			if (j >= m)
				ans++;
		}
		UtilityMethods.WriteLine(ans);
		Console.ReadLine();
	}
}


using System;
using System.Linq;
using System.Collections.Generic;

static class UtilityMethods
{
	public static void Swap<T>(ref T a, ref T b)
	{
		T t = a;
		a = b;
		b = t;
	}

	public static int StrToInt(string s)
	{
		int number = 0;
		for (int i = s[0] == '-' ? 1 : 0; i < s.Length; i++)
			number = number * 10 + (s[i] - '0');
		return s[0] == '-' ? -number : number;
	}
	public static long StrToLong(string s)
	{
		long number = 0;
		for (int i = s[0] == '-' ? 1 : 0; i < s.Length; i++)
			number = number * 10 + (s[i] - '0');
		return s[0] == '-' ? -number : number;
	}

	public static string ReadString() => Console.ReadLine();
	public static int ReadInt() => StrToInt(ReadString());
	public static long ReadLong() => StrToLong(ReadString());
	public static double ReadDouble() => double.Parse(ReadString());

	public static string[] ReadStringArray() => ReadString().Split();
	public static int[] ReadIntArray() => Array.ConvertAll(ReadStringArray(), StrToInt);
	public static long[] ReadLongArray() => Array.ConvertAll(ReadStringArray(), StrToLong);
	public static double[] ReadDoubleArray() => ReadStringArray().Select(double.Parse).ToArray();

	public static void WriteLine(object a) => Console.WriteLine(a);
	public static void WriteLineArray<T>(string separator, T[] a, int startIndex, int count)
	{
		const int MAXLEN = 1000000;
		int len = 0, j = startIndex, lastIndex = startIndex + count;
		System.Text.StringBuilder str;
		string[] b = Array.ConvertAll(a, x => x.ToString());
		for (int i = startIndex; i < lastIndex - 1; i++)
		{
			len += b[i].Length + separator.Length;
			if (len >= MAXLEN)
			{
				str = new System.Text.StringBuilder(len);
				for (; j <= i; j++)
				{
					str.Append(b[j]);
					str.Append(separator);
				}
				Console.Write(str);
				len = 0;
			}
		}
		str = new System.Text.StringBuilder(len);
		for (; j < lastIndex - 1; j++)
		{
			str.Append(b[j]);
			str.Append(separator);
		}
		Console.Write(str);
		Console.WriteLine(b.Last());
	}
}

class Program
{
	static void Main()
	{
		int[] data = UtilityMethods.ReadIntArray();
		int n = data[0], m = data[1], ans = 0;
		int[] a = UtilityMethods.ReadIntArray(), b = UtilityMethods.ReadIntArray();
		for (int i = 0, j = 0; i < n; i++)
		{
			for (; j < m && b[j] < a[i]; j++) ;
			j++;
			if (j >= m)
				ans++;
		}
		UtilityMethods.WriteLine(ans);
		Console.ReadLine();
	}
}


using System;
using System.Linq;

namespace CSharp
{
    public class _387B
    {
        public static void Main()
        {
            string[] tokens = Console.ReadLine().Split();

            int n = int.Parse(tokens[0]);
            int m = int.Parse(tokens[1]);

            int[] a = Console.ReadLine().Split().Select(token => int.Parse(token)).ToArray();
            int[] b = Console.ReadLine().Split().Select(token => int.Parse(token)).ToArray();

            Array.Sort(a);
            Array.Sort(b);

            int result = n;

            for (int i = 0, j = 0; i < n && j < m;)
            {
                if (a[i] <= b[j])
                {
                    i++;
                    j++;

                    result--;
                }
                else
                {
                    j++;
                }
            }

            Console.WriteLine(result);
        }
    }
}


using System;
using System.Collections.Generic;

namespace codeForce
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] input1 = Console.ReadLine().Split(' ');
            int n = int.Parse(input1[0]);
            int m = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            string[] input3 = Console.ReadLine().Split(' ');
            // Console.Write(Console.Read());

            List<int> listN = new List<int>();
            List<int> listM = new List<int>();
            for (int i = 0; i < n; i++)
            {
                listN.Add(int.Parse(input2[i]));
            }
            int mi = 0;
            int count=0;
            for (int i = 0; i < m; i++)
            {
                mi = int.Parse(input3[i]);
                listM.Add(mi);
            }
            int repeatCount=0;
            // bool isDelete = false;
            int j = 0;//j là biến chạy của list M
            int temp =0;

            for (int i = 0; i < n; i++)
            {
                while (listN[i]>listM[j])
                {
                    j++;
                }
                repeatCount++;
                j++;
                if (j == listM.Count)
                {
                    break;
                }

            }
            Console.WriteLine(n- repeatCount);

        }
    }
}


using System;
using System.Collections.Generic;

namespace codeForce
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] input1 = Console.ReadLine().Split(' ');
            int n = int.Parse(input1[0]);
            int m = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            string[] input3 = Console.ReadLine().Split(' ');
            // Console.Write(Console.Read());

            List<int> listN = new List<int>();
            List<int> listM = new List<int>();
            for (int i = 0; i < n; i++)
            {
                listN.Add(int.Parse(input2[i]));
            }
            int mi = 0;
            for (int i = 0; i < m; i++)
            {
                mi = int.Parse(input3[i]);
                listM.Add(mi);
            }
            int result=0;
            // bool isDelete = false;
            int j = 0;//j là biến chạy của list N
            int temp =0;
            if(listM[0] >= listN[n-1])
            {
                Console.WriteLine(n - m);
            }
            for (int i = 0; i < m; i++)
            {

                while (listM[i]>listN[j])
                {
                    j++;

                }
                if (listM[i] == listN[j] && listM[i] != temp)
                {
                    result++;
                    temp = listM[i];
                }

            }
            Console.WriteLine(n-result);

        }
    }
}


using System;
using System.Collections.Generic;

namespace codeForce
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] input1 = Console.ReadLine().Split(' ');
            int n = int.Parse(input1[0]);
            int m = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            string[] input3 = Console.ReadLine().Split(' ');
            // Console.Write(Console.Read());

            List<int> listN = new List<int>();
            List<int> listM = new List<int>();
            for (int i = 0; i < n; i++)
            {
                listN.Add(int.Parse(input2[i]));
            }
            int mi = 0;
            for (int i = 0; i < m; i++)
            {
                mi = int.Parse(input3[i]);
                listM.Add(mi);
            }
            int result=0;
            // bool isDelete = false;
            int j = 0;//j là biến chạy của list N
            int temp =0;
            if (listM[0] >= listN[n - 1])
            {
                result = m;
            }
            else
            {
                for (int i = 0; i < m; i++)
                {

                    while (listM[i] > listN[j])
                    {
                        j++;

                    }
                    if (listM[i] == listN[j] && listM[i] != temp)
                    {
                        result++;
                        temp = listM[i];
                    }

                }

            }
            Console.WriteLine(n - result);
        }
    }
}


using System;
using System.Collections.Generic;

namespace codeForce
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] input1 = Console.ReadLine().Split(' ');
            int n = int.Parse(input1[0]);
            int m = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            string[] input3 = Console.ReadLine().Split(' ');
            // Console.Write(Console.Read());

            List<int> listN = new List<int>();
            List<int> listM = new List<int>();
            for (int i = 0; i < n; i++)
            {
                listN.Add(int.Parse(input2[i]));
            }
            int mi = 0;
            for (int i = 0; i < m; i++)
            {
                mi = int.Parse(input3[i]);
                listM.Add(mi);
            }
            int repeatCount=0;
            // bool isDelete = false;
            int j = 0;//j là biến chạy của list M
            int temp =0;

            for (int i = 0; i < n && j < m; i++)
            {
                while (listN[i]>listM[j] && j < listM.Count - 1)
                {
                    j++;
                }
                if (listN[i] <= listM[j])
                {
                    repeatCount++;
                    j++;
                }

            }
            Console.WriteLine(n- repeatCount);

        }
    }
}


using System;
using System.Collections.Generic;

namespace codeForce
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] input1 = Console.ReadLine().Split(' ');
            int n = int.Parse(input1[0]);
            int m = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            string[] input3 = Console.ReadLine().Split(' ');
            // Console.Write(Console.Read());

            List<int> listN = new List<int>();
            List<int> listM = new List<int>();
            for (int i = 0; i < n; i++)
            {
                listN.Add(int.Parse(input2[i]));
            }
            int mi = 0;
            for (int i = 0; i < m; i++)
            {
                mi = int.Parse(input3[i]);
                listM.Add(mi);
            }
            int result=0;
            // bool isDelete = false;

            int j = 0;//j là biến chạy của list N
            int temp =0;
            for (int i = 0; i < m; i++)
            {

                while (listM[i]>listN[j])
                {
                    j++;

                }
                if (listM[i] >= listN[j] && listM[i] != temp)
                {
                    result++;
                    temp = listM[i];
                }

            }
            Console.WriteLine(n-result);

        }
    }
}


using System;
using System.Collections.Generic;

namespace codeForce
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] input1 = Console.ReadLine().Split(' ');
            int n = int.Parse(input1[0]);
            int m = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            string[] input3 = Console.ReadLine().Split(' ');
            // Console.Write(Console.Read());

            List<int> listN = new List<int>();
            List<int> listM = new List<int>();
            for (int i = 0; i < n; i++)
            {
                listN.Add(int.Parse(input2[i]));
            }
            int mi = 0;
            int count=0;
            for (int i = 0; i < m; i++)
            {
                mi = int.Parse(input3[i]);
                listM.Add(mi);
            }
            int repeatCount=0;
            // bool isDelete = false;
            int j = 0;//j là biến chạy của list M
            int temp =0;

            for (int i = 0; i < n; i++)
            {
                while (listN[i]>listM[j])
                {
                    j++;
                }
                repeatCount++;
                j++;
                if (j == listM.Count-1)
                {
                    break;
                }

            }
            Console.WriteLine(n- repeatCount);

        }
    }
}


using System;
using System.Collections.Generic;

namespace codeForce
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] input1 = Console.ReadLine().Split(' ');
            int n = int.Parse(input1[0]);
            int m = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            string[] input3 = Console.ReadLine().Split(' ');
            // Console.Write(Console.Read());

            List<int> listN = new List<int>();
            List<int> listM = new List<int>();
            for (int i = 0; i < n; i++)
            {
                listN.Add(int.Parse(input2[i]));
            }
            for (int i = 0; i < m; i++)
            {
                listM.Add(int.Parse(input3[i]));
            }
            int result=0;
            bool isDelete = false;
            for (int i = 0; i < m; i++)
            {

                if (listN.Count > 0)
                {
                    if (listM[i] == listN[0] && isDelete == false)
                    {
                        listN.Remove(listN[0]);
                        result++;
                        isDelete = true;
                    }
                    if (listM[i] != listM[Math.Min(m-1,i+1)])
                    {
                        isDelete = false;
                    }
                }
                else break;

            }
            Console.WriteLine(n-result);

        }
    }
}


using System;
using System.Collections.Generic;

namespace codeForce
{
    class Program
    {
        static void Main(string[] args)
        {

            string[] input1 = Console.ReadLine().Split(' ');
            int n = int.Parse(input1[0]);
            int m = int.Parse(input1[1]);

            string[] input2 = Console.ReadLine().Split(' ');
            string[] input3 = Console.ReadLine().Split(' ');
            // Console.Write(Console.Read());

            List<int> listN = new List<int>();
            List<int> listM = new List<int>();
            for (int i = 0; i < n; i++)
            {
                listN.Add(int.Parse(input2[i]));
            }
            int mi = 0;
            for (int i = 0; i < m; i++)
            {
                mi = int.Parse(input3[i]);
                if(mi>=listN[0] && mi<=listN[n-1])
                  listM.Add(mi);
            }
            int result=0;
            // bool isDelete = false;

            int j = 0;//j là biến chạy của list N
            m = listM.Count;
            int temp =0;
            for (int i = 0; i < m; i++)
            {

                while (listM[i]>listN[j])
                {
                    j++;

                }
                if (listM[i] == listN[j] && listM[i] != temp)
                {
                    result++;
                    temp = listM[i];
                }

            }
            Console.WriteLine(n-result);

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Codefores
{
    class Program
    {
        static void Main(string[] args)
        {
            Input();
        }
        public static void Input()
        {
            int n = 0;
            int m = 0;
            List<int> round_complexities = new List<int>();
            List<int> prepared_problems = new List<int>();

            string nmInput = Console.ReadLine();
            n = Int32.Parse(nmInput.Split(' ')[0]);
            m = Int32.Parse(nmInput.Split(' ')[1]);

            round_complexities = Console.ReadLine().Split(' ').Select(a => Int32.Parse(a)).ToList();
            prepared_problems = Console.ReadLine().Split(' ').Select(a => Int32.Parse(a)).ToList();

            List<int> minumumsArrays = new List<int>();
            //101 -> 200
            //6000 - 10000
            //5 10
            // 1 4 8 9 15 -> array A
            // 1 2 3 4 5 6 7 8 9 10 - array B
            for (int j = round_complexities.Count() - 1; j >= 0; j--)
            {
                var canSolve = prepared_problems.Where(a => a >= round_complexities[j]).ToList();
                if (canSolve.Count() > 0)
                {
                    if (!minumumsArrays.Contains(round_complexities[j]))
                    {
                        minumumsArrays.Add(round_complexities[j]);
                        prepared_problems.Remove(canSolve[0]);
                    }
                }

            }
            Console.WriteLine(round_complexities.Count() - minumumsArrays.Count());

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Codefores
{
    class Program
    {
        static void Main(string[] args)
        {
            Input();
        }
        public static void Input()
        {
            int n = 0;
            int m = 0;
            List<string> round_complexities = new List<string>();
            List<string> prepared_problems = new List<string>();

            string nmInput = Console.ReadLine();
            n = Int32.Parse(nmInput.Split(' ')[0]);
            m = Int32.Parse(nmInput.Split(' ')[1]);

            round_complexities = Console.ReadLine().Split(' ').ToList();
            prepared_problems = Console.ReadLine().Split(' ').ToList();

            List<string> minumumsArrays = new List<string>();
            //101 -> 200
            //6000 - 10000
            //5 10
            // 1 4 8 9 15 -> array A
            // 1 2 3 4 5 6 7 8 9 10 - array B
            for (int j = round_complexities.Count() - 1; j >= 0; j--)
            {
                var canSolve = prepared_problems.Where(a => (Int32.Parse(a) >= Int32.Parse(round_complexities[j]))).FirstOrDefault();
                if (canSolve != null)
                {
                    if (!minumumsArrays.Contains(round_complexities[j]))
                    {
                        minumumsArrays.Add(round_complexities[j]);
                        prepared_problems.Remove(canSolve);
                    }
                }

            }
            Console.WriteLine(round_complexities.Count() - minumumsArrays.Count());
            Console.ReadLine();

        }
    }
}


using System;
using System.Linq;

namespace Codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            //A673BeerAndGame.Input();
            // A518VitalyandStrings.Input();
            //Input();
           Input();
        }
        public static void Input()
        {
            int n = 0;
            int m = 0;
            string[] round_complexities = { };
            string[] prepared_problems = { };

            string nmInput = Console.ReadLine();
            n = Int32.Parse(nmInput.Split(' ')[0]);
            m = Int32.Parse(nmInput.Split(' ')[1]);

            round_complexities = Console.ReadLine().Split(' ').Distinct().ToArray();
            prepared_problems = Console.ReadLine().Split(' ');

            int count = round_complexities.Count();

            string[] distinct = prepared_problems.Distinct().ToArray();

            for (int i = 0; i < distinct.Count(); i++)
            {
                if (round_complexities.Contains(prepared_problems[i]))
                {
                    count--;
                }
            }

            Console.WriteLine(count);

        }

    }
}


using System;
using System.Linq;

namespace Codeforces
{
    class Program
    {
        static void Main(string[] args)
        {
            //A673BeerAndGame.Input();
            // A518VitalyandStrings.Input();
            //Input();
           Input();
        }
        public static void Input()
        {
            int n = 0;
            int m = 0;
            string[] round_complexities = { };
            string[] prepared_problems = { };

            string nmInput = Console.ReadLine();
            n = Int32.Parse(nmInput.Split(' ')[0]);
            m = Int32.Parse(nmInput.Split(' ')[1]);

            round_complexities = Console.ReadLine().Split(' ').Distinct().ToArray();
            prepared_problems = Console.ReadLine().Split(' ');

            int count = round_complexities.Count();

            string[] distinct = prepared_problems.Distinct().ToArray();

            for (int i = 0; i < distinct.Count(); i++)
            {
                if (round_complexities.Contains(distinct[i]))
                {
                    count--;
                }
            }

            Console.WriteLine(count);

        }

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codefores
{
    class Program
    {
        static void Main(string[] args)
        {
           Input();
        }
        public static void Input()
        {
            int n = 0;
            int m = 0;
            string[] round_complexities = { };
            string[] prepared_problems = { };

            string nmInput = Console.ReadLine();
            n = Int32.Parse(nmInput.Split(' ')[0]);
            m = Int32.Parse(nmInput.Split(' ')[1]);

            round_complexities = Console.ReadLine().Split(' ').ToArray();
            prepared_problems = Console.ReadLine().Split(' ');

            int count = round_complexities.Count();
            List<string> minumumsArrays = new List<string>();
            //101 -> 200
            //6000 - 10000
            if (n <= m)
                for (int j = 0; j < round_complexities.Count(); j++)
                {
                    if (Int32.Parse(round_complexities[j]) <= Int32.Parse(prepared_problems[j]))
                    {
                        minumumsArrays.Add(round_complexities[j]);

                    }
                }
            else if (n > m)
                for (int j = 0; j < prepared_problems.Count(); j++)
                {
                    if (Int32.Parse(round_complexities[j]) <= Int32.Parse(prepared_problems[j]))
                    {
                        minumumsArrays.Add(round_complexities[j]);

                    }
                }
            Console.WriteLine(round_complexities.Count() - minumumsArrays.Count);

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Codefores
{
    class Program
    {
        static void Main(string[] args)
        {
            Input();
        }
        public static void Input()
        {
            int n = 0;
            int m = 0;
            string[] round_complexities = { };
            string[] prepared_problems = { };

            string nmInput = Console.ReadLine();
            n = Int32.Parse(nmInput.Split(' ')[0]);
            m = Int32.Parse(nmInput.Split(' ')[1]);

            round_complexities = Console.ReadLine().Split(' ').ToArray();
            prepared_problems = Console.ReadLine().Split(' ');

            List<string> minumumsArrays = new List<string>();
            //101 -> 200
            //6000 - 10000
            //5 10
            // 1 4 8 9 15 -> array A
            // 1 2 3 4 5 6 7 8 9 10 - array B
            for (int j = round_complexities.Count() - 1; j >= 0; j--)
            {
                var canSolve = prepared_problems.Where(a => (Int32.Parse(a) >= Int32.Parse(round_complexities[j])));
                if (canSolve.Count() > 0)
                {
                    if(!minumumsArrays.Contains(round_complexities[j]))
                    minumumsArrays.Add(round_complexities[j]);
                }

            }
            Console.WriteLine(round_complexities.Count() - minumumsArrays.Count());

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;

namespace Codefores
{
    class Program
    {
        static void Main(string[] args)
        {
            Input();
        }
        public static void Input()
        {
            int n = 0;
            int m = 0;
            string[] round_complexities = { };
            string[] prepared_problems = { };

            string nmInput = Console.ReadLine();
            n = Int32.Parse(nmInput.Split(' ')[0]);
            m = Int32.Parse(nmInput.Split(' ')[1]);

            round_complexities = Console.ReadLine().Split(' ').ToArray();
            prepared_problems = Console.ReadLine().Split(' ');

            List<string> minumumsArrays = new List<string>();
            //101 -> 200
            //6000 - 10000
            //5 10
            // 1 4 8 9 15 -> array A
            // 1 2 3 4 5 6 7 8 9 10 - array B
            for (int j = round_complexities.Count() - 1; j >= 0; j--)
            {
                var canSolve = prepared_problems.Where(a => (Int32.Parse(a) >= Int32.Parse(round_complexities[j])));
                if (canSolve.Count() > 0)
                {
                    if (!minumumsArrays.Contains(round_complexities[j]))
                    {
                        minumumsArrays.Add(round_complexities[j]);
                        if (minumumsArrays.Count > round_complexities.Count()) break;
                    }
                }

            }
            Console.WriteLine(round_complexities.Count() - minumumsArrays.Count());
            Console.ReadLine();

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace round_227
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine().Split();
            int n = int.Parse(str[0]);
            int m = int.Parse(str[1]);
            int rez = 0;

            var arrA = Console.ReadLine().Split().Select(int.Parse).ToList();
            var arrB = Console.ReadLine().Split().Select(int.Parse).ToList();

            int l = arrB.Last();
            var newArrA = arrA.Where(x => x <= l).ToList();

            int lc = arrA.Count - newArrA.Count;
            rez += lc;

            int j = 0;
            for (int i = 0; i < arrB.Count && newArrA.Count > 0; i++)
            {
                if (newArrA[j] <= arrB[i])
                {
                    newArrA.RemoveAt(j);
                }
            }

            rez += newArrA.Count;
            Console.WriteLine(rez);

        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace round_227
{
    class Program
    {
        static void Main(string[] args)
        {
            var str = Console.ReadLine().Split();
            int n = int.Parse(str[0]);
            int m = int.Parse(str[1]);
            int rez = 0;

            var arrA = Console.ReadLine().Split().Select(int.Parse).ToList();
            var arrB = Console.ReadLine().Split().Select(int.Parse).ToList();

            int l = arrB.Last();
            var newArrA = arrA.Where(x => x <= l).ToList();

            int lc = arrA.Count - newArrA.Count;
            rez += lc;

            int j = 0;
            for (int i = 0; i < arrB.Count; i++)
            {
                if(newArrA[j] < arrB[i])
                {
                    j++;
                }else if(newArrA[j] == arrA[i])
                    newArrA.RemoveAt(j);
                else
                {
                    j--;
                    newArrA.RemoveAt(0);
                }
                if(newArrA.Count <= j)
                    break;
            }

            rez += newArrA.Count;
            Console.WriteLine(rez);

        }
    }
}


using System;
using System.Linq;

namespace problem_387B
{
	class problem_387B
	{
		static void Main(string[] args)
		{
			int[] ip = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
			int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
			int[] b = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
			int c = 0;
			for (int i = 0; i < ip[0]; i++)
			{
				if (b.Contains(a[i]) == false)
				{
					c++;
				}
			}
			Console.Write(c);
		}
	}
}


using System;
using System.Linq;

namespace problem_387B
{
	class problem_387B
	{
		static void Main(string[] args)
		{
			int[] ip = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
			int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
			int[] b = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
			int c = 0;
			int i = a.Length - 1;
			for (int j = b.Length - 1; i >= 0 && j >= 0; i--)
			{
				if (a[i] <= b[j])
				{
					j--;
				}
				else
				{
					c++;
				}
			}
			if (i != -1)
			{
				c += i + 1;
			}
			Console.Write(c);
		}
	}
}


using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using static System.Math;

// https://codeforces.com/problemset/problem/387/B
public class B___George_and_Round
{
    private static void Solve()
    {
        int n = ReadInt();
        int m = ReadInt();

        int[] a = ReadIntArray();
        int[] b = ReadIntArray();

        int aIndex = 0;
        for (int i = 0; i < m && aIndex < n; i++)
        {
            if (b[i] >= a[aIndex])
                aIndex++;
        }

        Write(n - aIndex);
    }

    #region Main

    private static TextReader reader;
    private static TextWriter writer;

    public static void Main()
    {
#if DEBUG

        //reader = new StreamReader("C:\\Users\\Axel\\Desktop\\input.txt");
        reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;

        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());

        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            Solve();

            //var thread = new Thread(new String_Task().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion Main

    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string Read()
    {
        while (currentLineTokens.Count == 0) currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(Read());
    }

    public static long ReadLong()
    {
        return long.Parse(Read());
    }

    public static double ReadDouble()
    {
        return double.Parse(Read(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray(); return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++) ret[i][j] = matrix[j][i]; }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim(); return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write(params object[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array) writer.WriteLine(a);
    }

    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }

    private static T[] Init<T>(int size) where T : new()
    {
        var ret = new T[size]; for (int i = 0; i < size; i++) ret[i] = new T(); return ret;
    }

    #endregion Read / Write
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SecondProblem
{
    class Program
    {
        static int Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries);
            int quantGoodRound = int.Parse(s[0]);
            int quantGeorgy = int.Parse(s[1]);
            s = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            List<int> lstGoodRound = new List<int>();
            for (int i=0; i<quantGoodRound;i++)
                lstGoodRound.Add(int.Parse(s[i]));
            lstGoodRound.Sort();
            s = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            List<int> lstGeorgyRound = new List<int>();
            for (int i = 0; i < quantGeorgy; i++)
                lstGeorgyRound.Add(int.Parse(s[i]));
            lstGeorgyRound.Sort();
            int answer = 0;
            for (int i = 0; i < quantGoodRound; i++)
            {
                bool found = false;
                for (int j = 0; j < quantGeorgy; j++)
                {
                    if (lstGeorgyRound[j] >= lstGoodRound[i])
                    {
                        lstGeorgyRound.RemoveAt(j);
                        quantGeorgy--;
                        found = true;
                        break;
                    }
                }
                if (!found)
                    answer++;
            }
            Console.WriteLine(answer);
            return 0;
        }
    }
}


use std::io;

#[allow(dead_code)]
fn solve() -> Vec<String> {
    let mut input = "".split_ascii_whitespace();
    let mut read = || loop {
        if let Some(word) = input.next() {
            break word;
        }
        input = {
            let mut input = "".to_owned();
            io::stdin().read_line(&mut input).unwrap();
            if input.is_empty() {
                panic!("reached EOF");
            }
            Box::leak(input.into_boxed_str()).split_ascii_whitespace()
        };
    };
    macro_rules! read(($ty:ty) => (read().parse::<$ty>().unwrap()));

    let mut rr = vec!["".to_string(); 0];

    let t = 1;
    for _ in 0..t {
        let n = read!(usize);
        let m = read!(usize);
        let mut a = vec![0; n];
        for i in 0..n {
            a[i] = read!(usize);
        }
        let mut b = vec![0; m];
        for i in 0..m {
            b[i] = read!(usize);
        }

        let mut bi = 0;
        let mut r = 0;
        for c in a.iter() {
            while bi < m && b[bi] < *c {
                bi += 1;
            }
            if bi < m {
                bi += 1;
            } else {
                r += 1;
            }
        }

        rr.push(format!("{}", r));
    }

    rr
}

#[allow(dead_code)]
fn main() {
    let output = solve();
    println!("{}", output.join("\n"));
}


package main
import (
	"fmt"
	//"bufio"
	//"os"
	//"strconv"
)

func main() {
	var n,m,i,j int
	fmt.Scan(&n,&m)
	a:=make([]int,n)
	b:=make([]int,m)
	for i=0;i<n;i++ {
		fmt.Scan(&a[i])
	}
	for i=0;i<m;i++ {
		fmt.Scan(&b[i])
	}
	for i,j=0,0; i<n && j<m;j++ {
		if b[j]>=a[i] {
			i++
		}
	}
	n-=i
	fmt.Println(n)
}


package main
import(
	"fmt"
	"bufio"
	"os"
	"strings"
	"strconv"
)

func main(){
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	nm := strings.Split(scanner.Text()," ")
	scanner.Scan()
	a := strings.Split(scanner.Text()," ")
	scanner.Scan()
	b := strings.Split(scanner.Text()," ")
	demA := 0
	// demB := 0
	n,_ := strconv.Atoi(nm[0])
	m,_ := strconv.Atoi(nm[1])
	for i := 0; i < m; i++{
		if demA == n{
			break
		}
		intB,_ := strconv.Atoi(b[i])
		intA,_ := strconv.Atoi(a[demA])
		if intB >= intA{
			demA += 1
		}
		// demB += 1
	}
	fmt.Println(n - demA)
}


package main

import (
	"fmt"
)

func main() {

	var (
		n, m, i, j int32
		a, b       [3006]int32
	)

	fmt.Scan(&n)
	fmt.Scan(&m)
	for i = 0; i < n; i++ {
		fmt.Scan(&a[i])
	}
	for i = 0; i < m; i++ {
		fmt.Scan(&b[i])
	}

	i, j = 0, 0
	for i < n && j < m {
		if a[i] <= b[j] {
			i, j = i+1, j+1
		} else {
			j = j + 1
		}

	}

	fmt.Println(n - i)

}


package main

import (
    "fmt"
    "sort"
)

func main() {
    var n,m int
    fmt.Scan(&n,&m)
    a, b := make([]int,n), make([]int,m)
    for i := 0; i < n; i++ { fmt.Scan(&a[i]) }
    for i := 0; i < m; i++ { fmt.Scan(&b[i]) }
    sort.Ints(a)
    sort.Ints(b)
    ib, ans := 0, 0
    for ia := 0; ia < n; ia++ {
        if ib >= m {
            ans++
        } else {
            for b[ib] < a[ia] {
                ib++
                if ib == m { ans++; break }
            }
            ib++
        }
    }
    fmt.Println(ans)
}


package main

import (
    "fmt"
    "sort"
)

func main() {
    var n,m int
    fmt.Scan(&n,&m)
    a, b := make([]int,n), make([]int,m)
    for i := 0; i < n; i++ { fmt.Scan(&a[i]) }
    for i := 0; i < m; i++ { fmt.Scan(&b[i]) }
    sort.Ints(a)
    sort.Ints(b)
    ib, ans := 0, 0
    for ia := 0; ia < n; ia++ {
        if ib == m {
            ans++
        } else {
            for b[ib] < a[ia] {
                ib++
                if ib == m { ans++; break }
            }
        }
    }
    fmt.Println(ans)
}


// 387B-mic
package main

import (
	"fmt"
)

func main() {
	var n, m int					// variabel n, m dengan jenis int
	var a, b [3005]int				// variabel a dan b [3005] jenis int
	fmt.Scan(&n, &m)				// mengambil input
	for i := 0; i < n; i++ {		// looping
		fmt.Scan(&a[i])				// mengambil input
	}
	for i := 0; i < m; i++ {		// looping kedua
		fmt.Scan(&b[i])				// mengambil input
	}
	be := n							// variabel be diisi dengan n
	if be > m {						// jika be lebih dari m
		be = m					    // be sama dengan m
	}
	for i := be; i >= 0; i-- {		// looping ketiga
		ok := true					// variabel ok diisi dengan true
		for j := 0; j < i; j++ {	// looping keempat
			if a[j] > b[m-i+j] {	// jika a[j] lebih dari  b[m-i+j]
				ok = false			// ok sama dengan false
			}
		}
		if ok {						// jika ok
			fmt.Println(n - i)		//cetak hasil n - i
			return					// kembali ke fungsi awal
		}
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

func solve(required []int, have []int, lenR int, lenH int) int {
	i, j := 0, 0

	for i < lenH {
		for j < lenR && i < lenH && required[j] > have[i] {
			i++
		}
		if j < lenR && i < lenH && required[j] <= have[i] {
			j++
		}
		i++
	}

	return lenR - j
}

func main() {
	r := bufio.NewReader(os.Stdin)

	var n, m int

	fmt.Fscanf(r, "%d %d\n", &n, &m)

	required := make([]int, n)
	have := make([]int, m)

	for i := range required {
		if i == n-1 {
			fmt.Fscanf(r, "%d\n", &required[i])
		} else {
			fmt.Fscanf(r, "%d", &required[i])
		}
	}

	for i := range have {
		fmt.Fscanf(r, "%d ", &have[i])
	}

	fmt.Fprintf(os.Stdout, "%d\n", solve(required, have, n, m))
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

func solve(required []int, have []int, lenR int, lenH int) int {
	i, j := 0, 0

	for i < lenH {
		if j < lenR && i < lenH && required[j] <= have[i] {
			j++
		}
		i++
	}

	return lenR - j
}

func main() {
	r := bufio.NewReader(os.Stdin)

	var n, m int

	fmt.Fscanf(r, "%d %d\n", &n, &m)

	required := make([]int, n)
	have := make([]int, m)

	for i := range required {
		if i == n-1 {
			fmt.Fscanf(r, "%d\n", &required[i])
		} else {
			fmt.Fscanf(r, "%d", &required[i])
		}
	}

	for i := range have {
		fmt.Fscanf(r, "%d ", &have[i])
	}

	fmt.Fprintf(os.Stdout, "%d\n", solve(required, have, n, m))
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

func solve(required []int, have []int, n int, m int) int {
	i, j := 0, 0

	for i < m {
		for j < n && i < m-1 && required[j] > have[i] {
			i++
		}
		if j < n && i < m && required[j] <= have[i] {
			j++
		}
		i++
	}

	return n - j
}

func main() {
	r := bufio.NewReader(os.Stdin)

	var n, m int

	fmt.Fscanf(r, "%d %d\n", &n, &m)

	required := make([]int, n)
	have := make([]int, m)

	for i := range required {
		if i == n-1 {
			fmt.Fscanf(r, "%d\n", &required[i])
		} else {
			fmt.Fscanf(r, "%d", &required[i])
		}
	}

	for i := range have {
		fmt.Fscanf(r, "%d ", &have[i])
	}

	fmt.Fprintf(os.Stdout, "%d\n", solve(required, have, n, m))
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

func solve(required []int, have []int, lenR int, lenH int) int {
	i, j := 0, 0

	for i < lenH {
		for i < lenH && required[j] > have[i] {
			i++
		}
		if j < lenR-1 && i < lenH && required[j] <= have[i] {
			j++
		}
		i++
	}

	return lenR - j
}

func main() {
	r := bufio.NewReader(os.Stdin)

	var n, m int

	fmt.Fscanf(r, "%d %d\n", &n, &m)

	required := make([]int, n)
	have := make([]int, m)

	for i := range required {
		if i == n-1 {
			fmt.Fscanf(r, "%d\n", &required[i])
		} else {
			fmt.Fscanf(r, "%d", &required[i])
		}
	}

	for i := range have {
		fmt.Fscanf(r, "%d ", &have[i])
	}

	fmt.Fprintf(os.Stdout, "%d\n", solve(required, have, n, m))
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

func solve(required []int, have []int, lenR int, lenH int) int {
	j := 0

	for i := 0; i < lenH; i++ {
		if j < lenR && i < lenH && required[j] <= have[i] {
			j++
		}
	}

	return lenR - j
}

func main() {
	r := bufio.NewReader(os.Stdin)

	var n, m int

	fmt.Fscanf(r, "%d %d\n", &n, &m)

	required := make([]int, n)
	have := make([]int, m)

	for i := range required {
		if i == n-1 {
			fmt.Fscanf(r, "%d\n", &required[i])
		} else {
			fmt.Fscanf(r, "%d", &required[i])
		}
	}

	for i := range have {
		fmt.Fscanf(r, "%d ", &have[i])
	}

	fmt.Fprintf(os.Stdout, "%d\n", solve(required, have, n, m))
}


// 387B-mic
package main

import (
    "fmt"
)

func main() {
    var n, m int
    var a, b [3005]int
    fmt.Scan(&n, &m)
    for i := 0; i < n; i++ {
        fmt.Scan(&a[i])
    }
    for i := 0; i < m; i++ {
        fmt.Scan(&b[i])
    }
    be := n
    if be > m {
        be = m
    }
    for i := be; i >= 0; i-- {
        ok := true
        for j := 0; j < i; j++ {
            if a[j] > b[m-i+j] {
                ok = false
            }
        }
        if ok {
            fmt.Println(n - i)
            return
        }
    }
}


// 387B-mic
package main

import (
    "fmt"
)

func main() {
    var n, m int
    var a, b [3005]int
    fmt.Scan(&n, &m)
    for i := 0; i < n; i++ {
        fmt.Scan(&a[i])
    }
    for i := 0; i < m; i++ {
        fmt.Scan(&b[i])
    }
    be := n
    if be > m {
        be = m
    }
    for i := be; i >= 0; i-- {
        ok := true
        for j := 0; j < i; j++ {
            if a[j] > b[m-i+j] {
                ok = false
            }
            if ok {
                fmt.Println(n - i)
                return
            }
        }
    }
}


//http://codeforces.com/problemset/problem/387/B

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func main() {
	reader := NewStdReader(os.Stdin)
	n, m := reader.ReadInt(), reader.ReadInt()

	a := make([]int, 3000)
	for i := 0; i < n; i++ {
		a[i] = reader.ReadInt()
	}

	ai := 0
	for i := 0; i < m; i++ {
		b := reader.ReadInt()
		if b >= a[ai] {
			ai++
			if ai == n {
				fmt.Print(0)
				return
			}
		}
	}

	c := n - ai
	fmt.Print(c)
}

type StdReader struct {
	buf *bufio.Reader
}

func NewStdReader(reader io.Reader) *StdReader {
	return &StdReader{bufio.NewReaderSize(reader, 2*1024*1024)}
}

func (std *StdReader) ReadInt() int {

	r := 0
	sign := 1
	ok := false

	for {
		b, e := std.buf.ReadByte()

		if e != nil {
			break
		}
		if b >= '0' && b <= '9' {
			r = r*10 + int(b-'0')
			ok = true
		} else {
			if ok {
				break
			} else {
				if b == '-' {
					sign = -sign
				}
			}
		}
	}

	return sign * r
}


//http://codeforces.com/problemset/problem/387/B

package main

import (
	"bufio"
	"io"
	"os"
	"fmt"
)

func main() {
	reader := NewStdReader(os.Stdin)
	n, m := reader.ReadInt(), reader.ReadInt()

	a := map[int]bool{}
	for i := 0; i < n; i++ {
		a[reader.ReadInt()] = false
	}

	for i := 0; i < m; i++ {
		a[reader.ReadInt()] = true
	}

	c := 0
	for _, v := range a {
		if !v {
			c++
		}
	}
	fmt.Print(c)
}

type StdReader struct {
	buf *bufio.Reader
}

func NewStdReader(reader io.Reader) *StdReader {
	return &StdReader{bufio.NewReaderSize(reader, 2*1024*1024)}
}

func (std *StdReader) ReadInt() int {

	r := 0
	sign := 1
	ok := false

	for {
		b, e := std.buf.ReadByte()

		if e != nil {
			break
		}
		if b >= '0' && b <= '9' {
			r = r*10 + int(b-'0')
			ok = true
		} else {
			if ok {
				break
			} else {
				if b == '-' {
					sign = -sign
				}
			}
		}
	}

	return sign * r
}


//http://codeforces.com/problemset/problem/387/B

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func main() {
	reader := NewStdReader(os.Stdin)
	n, m := reader.ReadInt(), reader.ReadInt()

	a := make([]int, 3000)
	for i := 0; i < n; i++ {
		a[i] = reader.ReadInt()
	}

	ai := 0
	for i := 0; i < m; i++ {
		b := reader.ReadInt()
		if b >= a[ai] {
			ai++
			if ai == n-1 {
				fmt.Print(0)
				return
			}
		}
	}

	c := n - ai
	fmt.Print(c)
}

type StdReader struct {
	buf *bufio.Reader
}

func NewStdReader(reader io.Reader) *StdReader {
	return &StdReader{bufio.NewReaderSize(reader, 2*1024*1024)}
}

func (std *StdReader) ReadInt() int {

	r := 0
	sign := 1
	ok := false

	for {
		b, e := std.buf.ReadByte()

		if e != nil {
			break
		}
		if b >= '0' && b <= '9' {
			r = r*10 + int(b-'0')
			ok = true
		} else {
			if ok {
				break
			} else {
				if b == '-' {
					sign = -sign
				}
			}
		}
	}

	return sign * r
}


<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
$c = explode(" ", trim(fgets(STDIN)));
$d = explode(" ", trim(fgets(STDIN)));
sort($c);
sort($d);
$e = 0;
for($x = count($c) - 1, $y = count($d) - 1; $x >= 0, $y >= 0; $x--, $y--)
{
    if($c[$x] <= $d[$y])
    {
        $e++;
    }
    else
    {
        array_splice($d, 0, 1);
    }
    if($x == 0)
    {
        break;
    }
}
print count($c) - $e;
?>


<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
$c = explode(" ", trim(fgets(STDIN)));
$d = explode(" ", trim(fgets(STDIN)));
sort($c);
sort($d);
$e = 0;
$f = count($d);
for($x = count($c) - 1, $y = $f - 1; $x >= 0, $y >= 0; $x--, $y--)
{
    if($c[$x] <= $d[$y])
    {
        $e++;
    }
    else
    {
        array_splice($d, 0, 1);
    }
    if(($x == 0) || ($y == 0))
    {
        break;
    }
}
print count($c) - $e;
?>


<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
$c = explode(" ", trim(fgets(STDIN)));
$d = explode(" ", trim(fgets(STDIN)));
rsort($c);
rsort($d);
$e = 0;
for($x = 0; $x < count($c); $x++)
{
    if($c[$x] <= $d[$x])
    {
        $e++;
    }
}
print count($c) - $e;
?>


<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
$c = explode(" ", trim(fgets(STDIN)));
$d = explode(" ", trim(fgets(STDIN)));
rsort($c);
rsort($d);
$e = count($d);
$f = 0;
for($x = 0; $x < count($c); $x++)
{
    for($y = 0; $y < $e; $y++)
    {
        if($d[$y] >= $c[$x])
        {
            $f++;
            unset($d[$y]);
            break;
        }
    }
}
print count($c) - $f;
?>


<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
$c = explode(" ", trim(fgets(STDIN)));
$d = explode(" ", trim(fgets(STDIN)));
sort($c);
sort($d);
$e = 0;
for($x = count($c) - 1, $y = count($d) - 1; $x >= 0, $y >= 0; $x--, $y--)
{
    if($c[$x] <= $d[$y])
    {
        $e++;
    }
    else
    {
        array_splice($d, 0, 1);
    }
    if(($x == 0) && ($y == 0))
    {
        break;
    }
}
print count($c) - $e;
?>


<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));
$c = explode(" ", trim(fgets(STDIN)));
$d = explode(" ", trim(fgets(STDIN)));
sort($c);
sort($d);
$e = 0;
for($x = count($c) - 1, $y = count($d) - 1; $x >= 0, $y >= 0; $x--, $y--)
{
    if($c[$x] <= $d[$y])
    {
        $e++;
    }
    else
    {
        array_splice($d, 0, 1);
    }
    if(($x == 0) || ($y == 0))
    {
        break;
    }
}
print count($c) - $e;
?>


import sys
n, m = map(int, sys.stdin.readline().split())
a = map(int, sys.stdin.readline().split())
b = map(int, sys.stdin.readline().split())
i = 0
j = 0
while i < n and j < m:
    if a[i] <= b[j]:
        i += 1
        j += 1
    else:
        j += 1

print n - i


n,m=map(int,raw_input().split())
l=list(map(int,raw_input().split()))
q=list(map(int,raw_input().split()))
q=list(set(q))
w=list(set(l)^set(q))
e=list(set(w).intersection(q))
print abs(len(w)-len(e))


n,m=map(int,raw_input().split())
l=list(map(int,raw_input().split()))
q=list(map(int,raw_input().split()))
e=list(set(l).intersection(q))
ma=l[-1]
c=0
for i in xrange(len(q)):
    if q[i]>ma:
        c+=1
print n-c-len(e)


n,m=map(int,raw_input().split())
l=list(map(int,raw_input().split()))
q=list(map(int,raw_input().split()))
i,j=0,0
while i<n and j<m:
    if q[j]>=l[i]:
        i+=1
    j+=1
print n-i


#Input = raw_input()
n, m = list(map(int, raw_input().split()))

#line = raw_input()
a = list(map(int, raw_input().split()))

#line = raw_input()
b = list(map(int, raw_input().split()))

#n = Inputs[0]
#m = Inputs[1]

i = 0
j = 0
result = n
count = 0

if a[0] > b[-1] or a[-1] < b[0]:
    result = 0
    for i in range(n):
        if a[i] <= 10**6:
            result += 1
else:
    for i in range(n):
        if a[i] <= 10**6:
            for j in range(m):
                if b[j] <= 10**6:
                    if a[i] > b[j]:
                        j += 1
                    elif a[i] == b[j]:
                        count += 1
                        j += 1
                        break
                    else:
                        break

result -= count

print result


#Input = raw_input()
n, m = list(map(int, raw_input().split()))

#line = raw_input()
a = list(map(int, raw_input().split()))

#line = raw_input()
b = list(map(int, raw_input().split()))

#n = Inputs[0]
#m = Inputs[1]

i = 0
j = 0
result = m
count = 0

if a[0] > b[-1] or a[-1] < b[0]:
    result = m
else:
    for i in range(n):
        for j in range(m):
            if a[i] > b[j]:
                j += 1
            elif a[i] == b[j]:
                count += 1
                j += 1
                break
            else:
                break

result -= count

print result


#Input = raw_input()
n, m = list(map(int, raw_input().split()))

#line = raw_input()
a = list(map(int, raw_input().split()))

#line = raw_input()
b = list(map(int, raw_input().split()))

#n = Inputs[0]
#m = Inputs[1]

i = 0
j = 0
result = n
count = 0

if a[0] > b[-1] or a[-1] < b[0]:
    result = n
else:
    for i in range(n):
        for j in range(m):
            if a[i] > b[j]:
                j += 1
            elif a[i] == b[j]:
                count += 1
                j += 1
                break
            else:
                break

result -= count

print result


#Input = raw_input()
n, m = list(map(int, raw_input().split()))

#line = raw_input()
a = list(map(int, raw_input().split()))

#line = raw_input()
b = list(map(int, raw_input().split()))

#n = Inputs[0]
#m = Inputs[1]

i = 0
j = 0
result = n
count = 0

if a[0] > b[-1] or a[-1] < b[0]:
    result = n
else:
    for i in range(n):
        if a[i] <= 10**6:
            for j in range(m):
                if b[j] <= 10**6:
                    if a[i] > b[j]:
                        j += 1
                    elif a[i] == b[j]:
                        count += 1
                        j += 1
                        break
                    else:
                        break

result -= count

print result


n, m = list(map(int, raw_input().split()))

a = list(map(int, raw_input().split()))

b = list(map(int, raw_input().split()))

# Merge 2 chuoi a va b vao chuoi temp
Temp = a + b
# tao bien a_i chay tu 0 toi n -1
a_i = 0
# tao bien b_i chay tu n toi m + n - 1
b_i = n
# tao bien count de den so luong so giong nhau
count = 0

while a_i < n and b_i < n + m:
    # Xet DK input phai nho hon 1 trieu
    if Temp[a_i] <= 10**6 and Temp[b_i] <= 10**6:
        # Neu gia tri cua mang a voi index a_i nho hon gia tri mang b voi index b_i, tang a_i
        if Temp[a_i] <= Temp[b_i]:
            count += 1
            a_i += 1
            b_i += 1
        else:
            # Neu gia tri cua mang a voi index a_i lon hon gia tri mang b voi index b_i, tang b_i
            if Temp[a_i] >= Temp[b_i]:
                b_i += 1
    else:
        break

# ket qua la lay len(a) - count
result = n - count

print result


#Input = raw_input()
n, m = list(map(int, raw_input().split()))

#line = raw_input()
a = list(map(int, raw_input().split()))

#line = raw_input()
b = list(map(int, raw_input().split()))

#n = Inputs[0]
#m = Inputs[1]

i = 0
j = 0
result = n
count = 0

if a[0] > b[-1] or a[-1] < b[0]:
    result = m
else:
    for i in range(n):
        for j in range(m):
            if a[i] > b[j]:
                j += 1
            elif a[i] == b[j]:
                count += 1
                j += 1
                break
            else:
                break

result -= count

print result


#Input = raw_input()
n, m = list(map(int, raw_input().split()))

#line = raw_input()
a = list(map(int, raw_input().split()))

#line = raw_input()
b = list(map(int, raw_input().split()))

#n = Inputs[0]
#m = Inputs[1]

i = 0
j = 0
result = n
count = 0

if a[0] > b[-1] or a[-1] < b[0]:
    for i in range(n):
        if a[i] <= 10**6:
            result += 1
else:
    for i in range(n):
        if a[i] <= 10**6:
            for j in range(m):
                if b[j] <= 10**6:
                    if a[i] > b[j]:
                        j += 1
                    elif a[i] == b[j]:
                        count += 1
                        j += 1
                        break
                    else:
                        break

result -= count

print result


Input = raw_input()
Inputs = list(map(int, Input.split()))

line = raw_input()
a = list(map(int, line.split()))

line = raw_input()
b = list(map(int, line.split()))

n = Inputs[0]
m = Inputs[1]

i=0
j=0
result = n
count = 0

if a[0] > b[-1] or a[-1] < b[0]:
    result = n
else:
    for i in range(n):
        for j in range(m):
            if a[i] > b[j]:
                j += 1
            elif a[i] == b[j]:
                count += 1
                j += 1
                break
            else:
                break

result = result - count

print result


n, m = list(map(int, raw_input().split()))

a = list(map(int, raw_input().split()))

b = list(map(int, raw_input().split()))

# i = 0
# j = 0
# pre = 0
# result = sum(1 for item in a if item <= 10**6)
# count = 0
#
# for i in range(n):
#     if a[i] <= 10**6:
#         for j in range(pre, m):
#             if a[i] > b[j]:
#                 pre += 1
#             elif a[i] == b[j]:
#                 count += 1
#                 pre += 1
#                 break
#             else:
#                 break
#     else:
#         break
#
# result -= count

Temp = a + b
a_i = 0
b_i = n
count = 0

while a_i < n and b_i < n + m:
    if Temp[a_i] <= 10**6 and Temp[b_i] <= 10**6:
        if Temp[a_i] < Temp[b_i]:
            a_i += 1
        else:
            if Temp[a_i] > Temp[b_i]:
                b_i += 1
            else:
                count += 1
                a_i += 1
                b_i += 1
    else:
        break

result = n - count

print result