#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007LL;
const long long inf = 1e18;
const long long maxx = 3e3 + 19;
long long n, m;
long long a[maxx], b[maxx];
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < m; i++) cin >> b[i];
  long long ans = min(n, m);
  for (long long i = ans; i >= 0; i--) {
    bool tmp = true;
    for (long long j = 0; j < i; j++)
      if (a[j] > b[m - i + j]) tmp = false;
    if (tmp) return cout << n - i, 0;
  }
  return 0;
}
