#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a[3005], b[3005];
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  int be = n;
  if (be > m) be = m;
  for (int i = be; i >= 0; i--) {
    bool ok = true;
    for (int j = 0; j < i; j++)
      if (a[j] > b[m - i + j]) ok = false;
    if (ok) {
      cout << n - i;
      return 0;
    }
  }
}
