#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int SIZE = 1e6 + 10;
int a[SIZE], b[SIZE], p[SIZE];
vector<int> d[SIZE];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (n); ++i) scanf("%d", &(a[i]));
  for (int i = 0; i < (m); ++i) scanf("%d", &(b[i]));
  for (int i = 0; i < (m); ++i) scanf("%d", &(p[i]));
  vector<pair<int, int> > pp;
  for (int i = 0; i < (m); ++i) pp.push_back(make_pair(b[i], p[i]));
  sort((pp).begin(), (pp).end());
  {
    int it = 0;
    for (int i = n - 1; i >= 0; i--) {
      while (it < ((int)(pp).size()) && pp[it].first <= a[i])
        d[i].push_back(pp[it++].second);
    }
  }
  long long now = 0;
  multiset<int> H;
  int an = 0;
  for (int i = 0; i < (n); ++i) {
    now += a[i];
    sort((d[i]).begin(), (d[i]).end());
    for (int j = 0; j < (((int)(d[i]).size())); ++j) {
      if (d[i][j] <= now) {
        now -= d[i][j];
        an++;
        H.insert(d[i][j]);
      } else if (!H.empty() && d[i][j] < *H.rbegin()) {
        now += *H.rbegin() - d[i][j];
        H.insert(d[i][j]);
        H.erase(H.find(*H.rbegin()));
      } else
        break;
    }
  }
  cout << an;
  return 0;
}
