#include <bits/stdc++.h>
using namespace std;
struct product {
  long long minp, cost, day;
  bool operator<(product a) const { return this->cost < a.cost; }
};
bool cmp(product a, product b) { return a.minp < b.minp; }
bool cmp2(product a, product b) { return a.day < b.day; }
long long days[200000];
product prods[200000];
priority_queue<product> inq;
int main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    cin >> days[i];
  }
  for (long long i = 0; i < m; i++) {
    cin >> prods[i].minp;
  }
  for (long long i = 0; i < m; i++) {
    cin >> prods[i].cost;
  }
  sort(prods, prods + m, cmp);
  long long day = n - 1;
  for (long long i = 0; i < m; i++) {
    for (day; day >= 0; day--) {
      if (days[day] >= prods[i].minp) {
        break;
      }
    }
    prods[i].day = day;
  }
  sort(prods, prods + m, cmp2);
  day = -1;
  long long money = 0;
  long long cnt = 0;
  for (long long i = 0; i < m; i++) {
    for (day; day < prods[i].day; day++) {
      money += days[day + 1];
    }
    if (money >= prods[i].cost) {
      money -= prods[i].cost;
      inq.push(prods[i]);
      cnt++;
    } else {
      if (!inq.empty() && inq.top().cost > prods[i].cost) {
        money += inq.top().cost;
        money -= prods[i].cost;
        inq.pop();
        inq.push(prods[i]);
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
