#include <bits/stdc++.h>
using namespace std;
long long int i, j, k;
long long int initpower, days, boost;
long long int plan[int(1e6)];
long long int moneyspent;
long long int numofdrinks;
vector<long long int> prices;
long long int findsum(vector<long long int> s, long long int index) {
  long long int sum = 0;
  for (long long int z = 0; z < index; z++) {
    sum += s[z];
  }
  return sum;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> days >> initpower;
  long long int weightperday;
  for (i = 0; i < days; i++) {
    cin >> weightperday;
    plan[i] = weightperday;
  }
  cin >> boost;
  for (long long int ef = 0; ef < days; ef++) {
    cin >> weightperday;
    prices.push_back(weightperday);
    sort(prices.begin(), prices.end());
    if (initpower < plan[ef]) {
      long long int to_go = plan[ef] - initpower;
      long long int to_drink = (to_go - 1) / boost + 1;
      if (prices.size() < to_drink) {
        cout << -1 << endl;
        return 0;
      } else {
        moneyspent += findsum(prices, to_drink);
        prices.erase(prices.begin(), prices.begin() + to_drink);
        initpower += to_drink * boost;
      }
    }
  }
  cout << moneyspent << endl;
}
