#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
pair<int, int> build[maxn];
vector<pair<int, long long> > a;
void init(int n, int m) {
  a.clear();
  for (int i = 0; i < n; ++i) {
    int t;
    scanf("%d", &t);
    a.push_back(make_pair(t, t));
    while (a.size() > 1 && a.back().first >= a[a.size() - 2].first) {
      a[a.size() - 2] =
          make_pair(a.back().first, a[a.size() - 2].second + a.back().second);
      a.pop_back();
    }
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d", &build[i].first);
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d", &build[i].second);
  }
}
void solve(int n, int m) {
  priority_queue<long long, vector<long long>, greater<long long> > qu;
  sort(build, build + m);
  sort(a.begin(), a.end());
  int ans = 0;
  for (int i = 0, j = 0; i < a.size(); ++i) {
    long long tot = a[i].second;
    int cur = a[i].first;
    while (j < m && build[j].first <= cur) {
      qu.push(build[j++].second);
    }
    while (!qu.empty()) {
      if (qu.top() <= tot) {
        ++ans;
        tot -= qu.top();
        qu.pop();
      } else {
        long long temp = qu.top() - tot;
        qu.pop();
        qu.push(temp);
        break;
      }
    }
  }
  cout << ans << endl;
}
int main() {
  int n, m;
  while (cin >> n >> m) {
    init(n, m);
    solve(n, m);
  }
  return 0;
}
