#include <bits/stdc++.h>
using namespace std;
long long n, currentEnergy;
int c[10000001];
long long ans = 0;
int main() {
  cin >> n >> currentEnergy;
  long long arr[n + 1];
  for (long long a = 0; a < n; ++a) {
    cin >> arr[a];
  }
  long long addEnergy = 0;
  cin >> addEnergy;
  for (long long a = 0; a < n; ++a) cin >> c[a];
  priority_queue<long long, vector<long long>, greater<long long> > q;
  for (long long a = 0; a < n && ans >= 0; ++a) {
    q.push(c[a]);
    while (currentEnergy < arr[a]) {
      if (!q.empty()) {
        ans += q.top();
        q.pop();
        currentEnergy += addEnergy;
      } else {
        ans = -1;
        break;
      }
    }
  }
  cout << ans;
  return 0;
}
