#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, z, k, l = 0, i, j, count = 0;
  cin >> n >> m;
  int a[n], b[m];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (i = 0; i < n; i++) {
    k = a[i];
    if (l == m) break;
    for (j = l; j < m; j++) {
      if (k == b[j]) {
        a[i] = 0;
        l = j + 1;
        break;
      } else {
        if (b[j] > k) {
          a[i] = 0;
          l = j + 1;
          break;
        }
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (a[i] != 0) {
      count++;
    }
  }
  cout << count;
  return 0;
}
