#include <bits/stdc++.h>
using namespace std;
const long long tMAX = 100000000000000000;
long long a, b, w, x, c;
long long f(long long t) {
  long long r = 1LL * t * x - b;
  r = ceil(1.0l * r / w);
  return (r - (1LL * a - c + t));
}
int main() {
  cin >> a >> b >> w >> x >> c;
  long long l = 0;
  long long r = tMAX;
  while (r != l) {
    long long m = (1LL * r + l) / 2;
    if (f(m) <= 0) {
      r = m;
    } else {
      l = m + 1;
    }
  }
  cout << r << endl;
  return 0;
}
