#include <bits/stdc++.h>
using namespace std;
int main() {
  queue<int> q1, q2;
  int m, n;
  int a, b;
  while (cin >> m >> n) {
    for (int i = 0; i < m; i++) {
      cin >> a;
      q1.push(a);
    }
    for (int i = 0; i < n; i++) {
      cin >> b;
      q2.push(b);
    }
    int tot = 0;
    while (!q1.empty() && !q2.empty()) {
      int c = q1.front();
      int d = q2.front();
      if (d >= c) {
        tot++;
        q2.pop();
      }
      q1.pop();
    }
    cout << tot << endl;
  }
  return 0;
}
