#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios::sync_with_stdio(0);
  solve();
  return 0;
}
int a[1000001];
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    int v;
    cin >> v;
    a[v]++;
  }
  for (int i = 0; i < m; ++i) {
    int v;
    cin >> v;
    a[v]--;
  }
  int ans = 0;
  int j = 0;
  for (int i = 1; i <= 1000000; ++i) {
    if (a[i] > 0) {
      j = max(j, i);
      bool f = 0;
      while (j <= 1000000 && !f) {
        if (a[j] < 0) {
          a[j]++;
          f = 1;
        } else
          j++;
      }
      ans += !f;
    }
  }
  cout << ans << "\n";
}
