#include <bits/stdc++.h>
using namespace std;
struct KLOSE {
  int b, p;
} _[100001];
long long n, m, a[100001], tmp, p, pos, ans, t;
bool cmp(KLOSE x, KLOSE y) { return x.b < y.b; }
priority_queue<int, vector<int>, greater<int> > q;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) scanf("%d", &_[i].b);
  for (int i = 1; i <= m; i++) scanf("%d", &_[i].p);
  sort(_ + 1, _ + m + 1, cmp);
  for (int now = n; now > 0; now = p - 1) {
    p = now;
    t = a[p];
    while (a[p - 1] <= a[now] && p > 1) t += a[--p];
    while (pos < m && _[pos + 1].b <= a[now]) q.push(_[++pos].p);
    while (!q.empty())
      if (t >= q.top())
        ans++, t -= q.top(), q.pop();
      else {
        tmp = q.top() - t;
        q.pop();
        q.push(tmp);
        t = 0;
        break;
      }
  }
  printf("%I64d\n", ans);
  return 0;
}
