#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long n) {
  if (n == 0) return 1;
  if (n % 2 == 0) {
    long long b = binpow(a, n / 2);
    return b * b;
  } else
    return a * binpow(a, n - 1);
}
int main() {
  int n, m;
  cin >> n >> m;
  stack<int> a, b;
  for (int i = 0; i < n; i++) {
    int first;
    cin >> first;
    a.push(first);
  }
  for (int i = 0; i < m; i++) {
    int first;
    cin >> first;
    b.push(first);
  }
  long long ans = 0;
  while (a.size() && b.size()) {
    int x1 = a.top(), x2 = b.top();
    a.pop();
    if (x1 <= x2)
      b.pop();
    else
      ans++;
  }
  cout << ans + a.size();
}
