#include <bits/stdc++.h>
int main() {
  int a, b, c, x, w, bin, cin;
  long long t = 0;
  scanf("%d%d%d%d%d", &a, &b, &w, &x, &c);
  bin = b, cin = c;
  if (c <= a) {
    printf("0\n");
    return 0;
  }
  while (1) {
    if (b >= x)
      c--, b -= x, t++;
    else
      b += w - x, t++;
    if (c <= a) {
      printf("%I64d\n", t);
      return 0;
    }
    if (b == bin) break;
  }
  int roop = (c - a - 1) / (cin - c);
  t += roop * t;
  c -= roop * (cin - c);
  while (1) {
    int tmp;
    if (b >= x) {
      tmp = (b - x) / x + 1;
      if (c - tmp > a) {
        b -= tmp * x;
        c -= tmp;
        t += tmp;
      } else {
        t += c - a;
        break;
      }
    } else {
      tmp = (x - b - 1) / (w - x) + 1;
      t += tmp;
      b += (w - x) * tmp;
    }
  }
  printf("%I64d\n", t);
  return 0;
}
