#include <bits/stdc++.h>
using namespace std;
vector<int> days;
multiset<int> price;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long a, current, money = 0, n, effect;
  cin >> n >> current;
  for (int i = 0; i < n; i++) {
    cin >> a;
    days.push_back(a);
  }
  cin >> effect;
  for (int i = 0; i < n; i++) {
    cin >> a;
    price.insert(a);
    if (money == -1)
      continue;
    else if (current < days[i]) {
      if (current + effect * price.size() >= days[i]) {
        while (current < days[i]) {
          current += effect;
          money += *(price.begin());
          price.erase(price.begin());
        }
      } else
        money = -1;
    }
  }
  cout << money;
  return 0;
}
