#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> G;
  vector<int> B;
  for (int i = 0; i < N; i++) {
    int k;
    cin >> k;
    G.push_back(k);
  }
  for (int i = 0; i < M; i++) {
    int k;
    cin >> k;
    B.push_back(k);
  }
  int current_game = 0;
  int current_bill = 0;
  int counter = 0;
  while (current_game < N && current_bill < M) {
    if (G[current_game] <= B[current_bill]) {
      counter++;
      current_bill++;
    }
    current_game++;
  }
  cout << counter << endl;
  return 0;
}
