#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
vector<long long> c[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<long long> a(n);
  for (long long& x : a) cin >> x;
  vector<pair<int, long long>> b(m);
  for (int i = 0; i < m; i++) {
    auto& [x, y] = b[i];
    y = i;
    cin >> x;
  }
  vector<long long> p(m);
  for (long long& x : p) cin >> x;
  sort(begin(b), end(b));
  for (int i = n, at = 0; at < m && i--;) {
    while (at < m && b[at].first <= a[i]) {
      c[i].push_back(p[b[at].second]);
      at++;
    }
  }
  long long budget = 0;
  long long cost = 0;
  priority_queue<long long> costs;
  for (int i = 0; i < n; i++) {
    budget += a[i];
    for (long long x : c[i]) {
      costs.push(x);
      cost += x;
    }
    while (cost > budget) {
      long long x = costs.top();
      costs.pop();
      cost -= x;
    }
  }
  cout << costs.size() << '\n';
}
