#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K;
  scanf("%d %d", &N, &K);
  int games[N], bills[K];
  for (int i = 0; i < N; i++) {
    scanf("%d", &games[i]);
  }
  for (int i = 0; i < K; i++) {
    scanf("%d", &bills[i]);
  }
  int cont = 0;
  for (int i = 0, j = 0; i < N && j < K; i++) {
    if (bills[j] >= games[i]) {
      cont++;
      j++;
    }
  }
  printf("%d", cont);
}
