#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
inline long long read() {
  register long long x = 0, f = 1;
  register char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  return x * f;
}
void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
void writeln(long long x) {
  write(x);
  puts("");
}
const int maxn = 1e5 + 233;
priority_queue<int> Q;
int n, m, a[maxn];
pair<int, int> b[maxn];
int main() {
  n = read();
  m = read();
  a[0] = 0x3f3f3f3f;
  for (register int i = (1); i <= int(n); ++i) a[i] = read();
  for (register int i = (1); i <= int(m); ++i) b[i].first = read();
  for (register int i = (1); i <= int(m); ++i) b[i].second = read();
  sort(b + 1, b + 1 + m);
  int j = 0, k, pre = 1, ans = 0;
  long long tot;
  for (register int i = (n); i >= int(1); --i) {
    tot = 0;
    for (j = i; a[j] <= a[i]; --j) tot += a[j];
    for (k = pre; k <= m && b[k].first <= a[i]; ++k) Q.push(-b[k].second);
    pre = k;
    while (!Q.empty()) {
      if (tot >= -Q.top())
        ans++, tot -= -Q.top(), Q.pop();
      else {
        tot = -Q.top() - tot;
        Q.pop();
        Q.push(-tot);
        break;
      }
    }
    i = j + 1;
  }
  writeln(ans);
  return 0;
}
