#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 100;
long long a[N], val[N];
pair<int, int> b[N];
int n, m;
priority_queue<int> que;
int cal() {
  long long cur = val[1];
  int j = m;
  while (j && b[j].first > a[1]) j--;
  for (int i = 2; i <= n + 1; i++) {
    while (j && b[j].first > a[i]) {
      if (cur >= b[j].second)
        cur -= b[j].second, que.push(b[j].second);
      else if (!que.empty() && que.top() > b[j].second)
        cur += que.top() - b[j].second, que.pop(), que.push(b[j].second);
      j--;
    }
    cur += val[i];
  }
  return que.size();
}
int main() {
  cin >> n >> m;
  int top = 0;
  for (int i = 1; i <= n; i++) {
    long long num, tmp_val = 0;
    scanf("%lld", &num);
    while (top && a[top] <= num) {
      tmp_val += val[top];
      val[top] = a[top] = 0;
      top--;
    }
    a[++top] = num;
    val[top] = tmp_val + num;
  }
  n = top;
  for (int i = 1; i <= m; i++) scanf("%d", &b[i].first);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i].second);
  sort(b + 1, b + 1 + m);
  printf("%d\n", cal());
}
