#include <bits/stdc++.h>
using namespace std;
int n, m, a[100005];
pair<int, int> ps[100005];
int main() {
  a[0] = 1000000007;
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) cin >> ps[i].first;
  for (int i = 1; i <= m; i++) cin >> ps[i].second;
  sort(ps + 1, ps + m + 1);
  priority_queue<int, vector<int>, greater<int> > Q;
  int j = 0, k, pre = 1, ans = 0;
  long long tot;
  for (int i = n; i >= 1; i = j) {
    tot = 0;
    for (j = i; a[j] <= a[i]; j--) tot += a[j];
    for (k = pre; (k <= m) && (ps[k].first <= a[i]); k++) Q.push(ps[k].second);
    pre = k;
    while (!Q.empty())
      if (tot >= Q.top()) {
        ans++;
        tot -= Q.top();
        Q.pop();
      } else {
        tot = Q.top() - tot;
        Q.pop();
        Q.push(tot);
        break;
      }
  }
  cout << ans << endl;
  return 0;
}
