#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, w, x, c, c1;
  cin >> a >> b >> w >> x >> c;
  c1 = c;
  while (a < c) {
    long long step = c - a;
    c = a;
    long long delta = (step * x - b);
    long long res = ceil((double)delta / w);
    b = res * w - delta;
    a -= res;
  }
  cout << c1 - c << endl;
}
