#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  cin >> n >> m;
  int bills[m];
  int games[n];
  int buy = 0;
  int c = 0;
  for (int i = 0; i < n; i++) {
    cin >> games[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> bills[i];
  }
  for (int i = 0; i < n; i++) {
    if (bills[c] >= games[i]) {
      buy++;
      c++;
    }
    if (c >= m) {
      break;
    }
  }
  cout << buy << endl;
  return 0;
}
