#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, p = 0, q = 0, n = 0;
  cin >> a >> b;
  long long c[a], m[b];
  for (long long i = 0; i < a; i++) cin >> c[i];
  for (long long i = 0; i < b; i++) cin >> m[i];
  while (p < a && q < b) {
    if (m[q] >= c[p]) {
      n++;
      q++;
    }
    p++;
  }
  cout << n << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
}
