#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a;
  vector<int> b;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  for (int j = 0; j < m; j++) {
    int y;
    cin >> y;
    b.push_back(y);
  }
  for (int i = 0; i < n - m; i++) b.push_back(0);
  int item = 0;
  for (int k = 0; k < n;) {
    if (b[k] >= a[k]) {
      item++;
    } else if (b[k] < a[k]) {
      a.erase(a.begin() + k);
      k--;
      n--;
    }
    k++;
  }
  cout << item;
}
