#include <bits/stdc++.h>
using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(NULL);int n, m;if (!(cin >> n >> m)) return 0;vector<int> cookies(n);vector<int> children(m);for (int i = 0; i < n; i) {cin >> cookies[i];}for (int i = 0; i < m; i) {cin >> children[i];}sort(cookies.begin(),
cookies.end());sort(children.begin(), children.end());int child_idx = 0;int cookie_idx = 0;int satisfied_count = 0;while (child_idx < m && cookie_idx < n) {if (cookies[cookie_idx] >= children[child_idx]) {satisfied_count;child_idx;cookie_idx++;} else {cookie_idx++;}}cout << satisfied_count <<
endl;return 0;}