#include <bits/stdc++.h>
using namespace std;
void getint(int &v) {
  char ch, fu = 0;
  for (ch = '*'; (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') fu = 1, ch = getchar();
  for (v = 0; ch >= '0' && ch <= '9'; ch = getchar()) v = v * 10 + ch - '0';
  if (fu) v = -v;
}
const int INF = 1e9 + 10;
multiset<int, greater<int> > S;
vector<int> v[100010];
int n, m, b[500010], p[500010], a[500010], ans, stk[500010], top;
long long s[500010], mny;
int main() {
  getint(n), getint(m);
  for (int i = 1; i <= n; i++) getint(a[i]);
  stk[top = 1] = a[1];
  s[1] = a[1];
  for (int i = 2; i <= n; i++) {
    long long t = a[i];
    while (top && a[i] >= stk[top]) t += s[top], --top;
    stk[++top] = a[i];
    s[top] = t;
  }
  n = top;
  a[0] = INF;
  for (int i = 1; i <= n; i++) a[i] = stk[i];
  for (int i = 1; i <= m; i++) getint(b[i]);
  for (int i = 1; i <= m; i++) getint(p[i]);
  for (int i = 1; i <= m; i++) {
    int l = 0, r = n;
    while (l < r) {
      int o = (l + r >> 1) + 1;
      if (b[i] <= a[o])
        l = o;
      else
        r = o - 1;
    }
    v[r].push_back(p[i]);
  }
  for (int i = 1; i <= n; i++) {
    mny += s[i];
    for (int j = 0; j < v[i].size(); ++j) {
      int t = v[i][j];
      if (mny >= t) {
        mny -= t;
        S.insert(t);
      } else {
        int e = *S.begin();
        if (t >= e) continue;
        S.erase(S.begin());
        mny += e;
        S.insert(t);
        mny -= t;
      }
    }
  }
  cout << S.size() << endl;
  return 0;
}
