#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, performance, cost = 0;
  multiset<int> remaining_c;
  cin >> n >> k;
  int x[n], c[n];
  for (int& e : x) cin >> e;
  cin >> performance;
  for (int& e : c) cin >> e;
  for (int i = 0; i < n; i++) {
    remaining_c.insert(c[i]);
    if (k >= x[i])
      ;
    else {
      while (x[i] > k) {
        if (remaining_c.empty()) {
          cout << "-1\n";
          return 0;
        }
        cost += *remaining_c.begin(), k += performance,
            remaining_c.erase(remaining_c.begin());
      }
    }
  }
  cout << cost << "\n";
  return 0;
}
