#include <bits/stdc++.h>
using namespace std;
const long long int mod = 10e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n;
  cin >> n;
  long long int h, b;
  cin >> h;
  vector<int> v(n), cost(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  cin >> b;
  for (int i = 0; i < n; i++) cin >> cost[i];
  long long int ans = 0;
  priority_queue<int, vector<int>, greater<int> > pq;
  for (int i = 0; i < n; i++) {
    pq.push(cost[i]);
    if (h >= v[i])
      ans += 0;
    else {
      int flag = 0;
      while (pq.size()) {
        h += b;
        ans += pq.top();
        pq.pop();
        if (h >= v[i]) {
          flag = 1;
          break;
        }
      }
      if (!flag) {
        ans = -1;
        break;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
