#include <bits/stdc++.h>
using namespace std;
int main() {
  int ngames, nbills, inp, billptr = 0, sold = 0;
  vector<int> gamecost;
  vector<int> bills;
  cin >> ngames >> nbills;
  for (int i = 0; i < ngames; i++) {
    cin >> inp;
    gamecost.push_back(inp);
  }
  for (int i = 0; i < nbills; i++) {
    cin >> inp;
    bills.push_back(inp);
  }
  int line = gamecost.size();
  for (int i = 0; i < line; i++)
    if (bills[billptr] >= gamecost[i]) {
      sold++;
      if (billptr != bills.size() - 1)
        billptr++;
      else
        break;
    }
  cout << sold;
}
