#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
long long a[N], b[N], p[N], suf[N];
int n, m;
vector<int> good[N];
int st[4 * N];
void build(int l = 1, int r = n, int curr = 1) {
  int mid = l + (r - l) / 2;
  if (l == r) {
    st[curr] = a[l];
    return;
  }
  build(l, mid, 2 * curr);
  build(mid + 1, r, 2 * curr + 1);
  st[curr] = max(st[2 * curr], st[2 * curr + 1]);
}
int find(int x, int l = 1, int r = n, int curr = 1) {
  int mid = l + (r - l) / 2;
  if (l == r) {
    return l;
  }
  if (st[2 * curr + 1] >= x) {
    return find(x, mid + 1, r, 2 * curr + 1);
  } else if (st[2 * curr] >= x)
    return find(x, l, mid, 2 * curr);
  return n + 1;
}
int32_t main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  build();
  for (int i = 1; i <= m; i++) {
    scanf("%lld", &b[i]);
    int L = 1, R = n;
    int ans = find(b[i]);
    good[ans].push_back(i);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%lld", &p[i]);
  }
  priority_queue<long long> pq;
  long long cur = 0;
  for (int i = 1; i <= n; i++) {
    priority_queue<long long, vector<long long>, greater<long long> > curr;
    for (auto w : good[i]) curr.push(p[w]);
    cur += 1ll * a[i];
    while (((int)(curr).size() && (int)(pq).size() && pq.top() > curr.top()) ||
           ((int)(curr).size() && curr.top() <= cur)) {
      if ((int)(curr).size() && curr.top() <= cur) {
        pq.push(curr.top());
        cur -= curr.top();
        curr.pop();
      } else {
        cur += pq.top();
        pq.pop();
        cur -= curr.top();
        pq.push(curr.top());
        curr.pop();
      }
    }
  }
  printf("%d\n", (int)(pq).size());
}
