#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m;
  scanf("%i %i", &n, &m);
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    scanf("%i", &a[i]);
  }
  vector<int> b(m + 1);
  for (int i = 1; i <= m; i++) {
    scanf("%i", &b[i]);
  }
  vector<int> p(m + 1);
  for (int i = 1; i <= m; i++) {
    scanf("%i", &p[i]);
  }
  vector<pair<int, int>> S;
  for (int i = 1; i <= m; i++) {
    S.push_back(make_pair(b[i], p[i]));
  }
  sort(begin(S), end(S));
  priority_queue<int, vector<int>, greater<int>> A;
  int r = 0;
  int ans = 0;
  for (int i = n; i >= 1; i--) {
    while (r < m && S[r].first <= a[i]) {
      A.push(S[r].second);
      r++;
    }
    while (!A.empty() && a[i] >= A.top()) {
      a[i] -= A.top();
      A.pop();
      ans++;
    }
    if (!A.empty()) {
      int v = A.top();
      A.pop();
      v -= a[i];
      A.push(v);
    }
  }
  printf("%i\n", ans);
  return 0;
}
