#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<long long> x(n);
  for (long long i = 0; i < n; ++i) {
    cin >> x[i];
  }
  long long a;
  cin >> a;
  vector<long long> c(n);
  for (long long j = 0; j < n; ++j) {
    cin >> c[j];
  }
  long long init = k, cost = 0;
  set<long long> st;
  long long i;
  for (i = 0; i < n; i++) {
    st.insert(c[i]);
    if (init < x[i]) {
      while (!st.empty() and init < x[i]) {
        cost += *st.begin();
        st.erase(st.begin());
        init += a;
      }
    }
    if (init < x[i]) break;
  }
  if (i == n)
    cout << cost << '\n';
  else
    cout << -1 << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long t = 1;
  while (t--) solve();
  return 0;
}
