#include <bits/stdc++.h>
using namespace std;
long long a, b, w, x, c;
long long f(long long k) {
  if (x * k - b <= 0ll) return 0ll;
  return (x * k - b - 1) / w + 1;
}
int main() {
  scanf("%lld %lld %lld %lld %lld", &a, &b, &w, &x, &c);
  long long l = 0, r = 1e18, answ = -1;
  while (l <= r) {
    long long m = (l + r) >> 1;
    if (a - f(m) >= c - m) {
      answ = m;
      r = m - 1;
    } else
      l = m + 1;
  }
  printf("%lld", answ);
}
