#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, w, x, c, t;
  scanf("%I64d %I64d %I64d %I64d %I64d", &a, &b, &w, &x, &c);
  if (c <= a) return puts("0"), 0;
  long long ans = 0;
  while (c > a) {
    t = c - a;
    ans += t;
    b = b - (long long)t * x;
    if (b >= 0) break;
    c = a;
    a -= ((-b) - 1) / w + 1;
    b = ((b % w) + w) % w;
  }
  printf("%I64d\n", ans);
  return 0;
}
