#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int N = 300005;
const int M = 300005;
int n, m, ans, tp;
int s[N];
long long tot;
long long a[N], b[N], p[N];
vector<long long> c[N];
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i <= m; i++) b[i] = read();
  for (int i = 1; i <= m; i++) p[i] = read();
  for (int i = 1; i <= n; i++) {
    while (tp && a[i] >= a[s[tp]]) --tp;
    s[++tp] = i;
  }
  for (int i = 1; i <= m; i++) {
    if (b[i] > a[s[1]]) continue;
    int l = 1, r = tp, pos = 0;
    while (l <= r) {
      int mid = l + r >> 1;
      if (a[s[mid]] >= b[i])
        pos = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    c[s[pos]].push_back(p[i]);
  }
  priority_queue<long long> Q;
  for (int i = 1; i <= n; i++) {
    int x = c[i].size();
    sort(c[i].begin(), c[i].begin() + x);
    tot += a[i];
    for (int j = 0; j <= x - 1; j++)
      if (c[i][j] <= tot) {
        tot -= c[i][j];
        Q.push(c[i][j]);
        ans++;
      } else {
        if (Q.empty()) continue;
        long long tmp = Q.top();
        if (tmp > c[i][j]) {
          Q.pop();
          Q.push(c[i][j]);
          tot += tmp - c[i][j];
        }
      }
  }
  printf("%d\n", ans);
  return 0;
}
