#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
priority_queue<int, vector<int>, greater<int> > q;
int a[N], ans, n, m;
struct note {
  int b, p;
} b[N];
bool cmp(note x, note y) { return x.b < y.b; }
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", &b[i].b);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i].p);
  std::sort(b + 1, b + m + 1, cmp);
  int j = 1;
  for (int i = n, p = n; i; i = p) {
    long long tot = 0;
    while (p && a[p] <= a[i]) tot += a[p--];
    while (j <= m && b[j].b <= a[i]) q.push(b[j++].p);
    while (q.size() && tot) {
      int t = q.top();
      q.pop();
      if (tot >= t) {
        tot -= t;
        ans++;
      } else {
        q.push(t - tot);
        tot = 0;
      }
    }
  }
  printf("%d\n", ans);
}
