#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  unsigned n{}, m{};
  cin >> n >> m;
  vector<unsigned> games(n);
  vector<unsigned> bills(m);
  for (auto &val : games) cin >> val;
  for (auto &val : bills) cin >> val;
  size_t j{}, count{};
  for (auto const &val : games) {
    if (j >= m) break;
    if (bills.at(j) >= val) {
      ++count;
      ++j;
    }
  }
  cout << count << endl;
  return 0;
}
