#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
long long a, b, w, x, c, d;
bool first(long long k) {
  long long q = b + k * d;
  long long ta = a - q;
  long long tc = c - q;
  long long tq = q / x;
  tc -= tq;
  if (tc <= ta) return true;
  return false;
}
int main() {
  cin >> a >> b >> w >> x >> c;
  long long ans = 0;
  d = w - x;
  long long l = 0, r = 100000000000000LL, res = r;
  while (l <= r) {
    long long m = (l + r) / 2;
    if (first(m)) {
      r = m - 1;
      res = m;
    } else
      l = m + 1;
  }
  long long w = b + res * d;
  ans += res;
  long long k = w / x;
  k = min(k, c - a);
  ans += k;
  cout << ans;
  return 0;
}
