#include <bits/stdc++.h>
using namespace std;
#pragma GCC diagnostic ignored "-Wmissing-declarations"
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  for (int& x : a) cin >> x;
  vector<pair<int, int> > b(m);
  for (auto& x : b) cin >> x.first;
  for (auto& x : b) cin >> x.second;
  sort(begin(b), end(b));
  int ind = 0;
  vector<vector<int> > tr(n);
  for (int i = n - 1; i >= 0; --i) {
    while (ind < m && b[ind].first <= a[i]) tr[i].push_back(b[ind++].second);
    sort(tr[i].rbegin(), tr[i].rend());
  }
  priority_queue<int> s;
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    auto& cur = tr[i];
    sum += a[i];
    for (;;) {
      while (!cur.empty() && cur.back() <= sum) {
        sum -= cur.back();
        s.push(cur.back());
        cur.pop_back();
      }
      if (cur.empty() || s.empty() || cur.back() >= s.top()) break;
      sum += s.top();
      s.pop();
    }
  }
  cout << s.size() << endl;
}
