#include <bits/stdc++.h>
using namespace std;
bool comp(pair<long long int, long long int> a,
          pair<long long int, long long int> b) {
  return a.first < b.first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, it = 0, ans = 0;
  cin >> n >> m;
  long long int a[n], b[m], p[m];
  vector<pair<long long int, long long int> > v;
  priority_queue<long long int, vector<long long int>, greater<long long int> >
      pq;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  for (int i = 0; i < m; i++) cin >> p[i];
  for (int i = 0; i < m; i++) v.push_back(make_pair(b[i], p[i]));
  sort(v.begin(), v.end(), comp);
  for (int i = n - 1; i >= 0; i--) {
    while (v[it].first <= a[i] && it < m) {
      pq.push(v[it].second);
      it++;
    }
    while (!pq.empty() && a[i] >= pq.top()) {
      a[i] -= pq.top();
      pq.pop();
      ans++;
    }
    if (!pq.empty()) {
      long long int x = pq.top();
      pq.pop();
      x -= a[i];
      pq.push(x);
    }
  }
  cout << ans << endl;
  return 0;
}
