#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
int n, m;
const int N = 1e5 + 100;
int a[N];
pair<int, int> cons[N];
priority_queue<int, vector<int>, greater<int> > tenho;
vector<int> ultimos[N];
int last[N];
long long dimdim[N];
int main() {
  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", &cons[i].first);
  for (int i = 0; i < m; i++) scanf("%d", &cons[i].second);
  sort(cons, cons + m);
  for (int i = 0; i < n; i++) {
    last[i] = lower_bound(cons, cons + m, make_pair(a[i], INF)) - cons;
  }
  int pri = 0;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = pri; j < last[i]; j++) ultimos[i].push_back(cons[j].second);
    pri = max(pri, last[i]);
  }
  long long dindin = 0;
  int r = 0;
  for (int i = n - 1; i >= 0; i--) {
    dindin = a[i];
    for (int x : ultimos[i]) {
      tenho.push(x);
    }
    while (tenho.size() > 0 and dindin >= tenho.top()) {
      dindin -= tenho.top();
      tenho.pop();
      r++;
    }
    if (tenho.size() > 0) {
      int x = tenho.top();
      tenho.pop();
      tenho.push(x - dindin);
    }
  }
  printf("%d\n", r);
  return 0;
}
