#include <bits/stdc++.h>
int binsearch(long int search, long int array[], int n) {
  int first = 0;
  int last = n - 1;
  int middle = (first + last) / 2;
  while (first <= last) {
    if (array[middle] < search)
      first = middle + 1;
    else if (array[middle] == search) {
      return middle;
    } else
      last = middle - 1;
    middle = (first + last) / 2;
  }
  if (first > last) return -1;
}
int main(void) {
  int n, m;
  long int count = 0;
  long int a[3000];
  long int b[3000];
  int i, j;
  scanf("%d", &n);
  scanf("%d", &m);
  for (i = 0; i < n; i++) scanf("%ld", &a[i]);
  for (i = 0; i < m; i++) scanf("%ld", &b[i]);
  int index = 0;
  for (i = 0; i < n; i++) {
    for (j = index; j < m; j++) {
      if (a[i] == b[j] || b[j] > a[i]) {
        index = j + 1;
        break;
      }
    }
    if (j == m) count++;
  }
  printf("%ld", count);
  return 0;
}
