#include <bits/stdc++.h>
using namespace std;
bool marked[5010];
int main() {
  long long a, b, w, x, c;
  cin >> a >> b >> w >> x >> c;
  if (c <= a) {
    cout << 0 << endl;
    return 0;
  }
  long long t = 0;
  while (!marked[b]) {
    marked[b] = true;
    if (b < x)
      b += w - x;
    else {
      b -= x;
      c--;
    }
    t++;
    if (c <= a) {
      cout << t << endl;
      return 0;
    }
  }
  long long len = 0;
  memset(marked, false, sizeof marked);
  long long diff = 0;
  int startT = -1;
  while (!marked[b]) {
    marked[b] = true;
    len++;
    if (b < x)
      b += w - x;
    else {
      diff++;
      b -= x;
      c--;
      startT = b;
    }
    t++;
    if (c <= a) {
      cout << t << endl;
      return 0;
    }
  }
  while (b != startT) {
    if (b < x)
      b += w - x;
    else {
      b -= x;
      c--;
    }
    t++;
    if (c <= a) {
      cout << t << endl;
      return 0;
    }
  }
  t += ((c - a) / diff) * len;
  c = ((c - a) % diff) + a;
  if (c <= a) {
    cout << t << endl;
    return 0;
  }
  memset(marked, false, sizeof marked);
  while (!marked[b]) {
    marked[b] = true;
    if (b < x)
      b += w - x;
    else {
      b -= x;
      c--;
    }
    t++;
    if (c <= a) {
      cout << t << endl;
      return 0;
    }
  }
}
