#include <bits/stdc++.h>
using namespace std;
long long a, b, c, x, w;
int main() {
  cin >> a >> b >> w >> x >> c;
  long long l = 0LL, r = 1000000000000000000LL, ans = r;
  while (l <= r) {
    long long m = (l + r) / 2LL;
    long long v = b - x * m;
    if (v >= 0LL) {
      if (a >= c - m) {
        ans = min(m, ans);
        r = m - 1LL;
      } else {
        l = m + 1LL;
      }
    } else {
      long long cnt = -v / w;
      while (v + (cnt)*w < 0LL) cnt++;
      if (a - cnt >= c - m) {
        ans = min(m, ans);
        r = m - 1LL;
      } else {
        l = m + 1LL;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
