#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, x, y;
  cin >> a >> b >> x >> y;
  int g = a * x / (x - 1);
  while (g * (x * y - 1) < x * y * (a + b)) g++;
  cout << g - 1 << "\n";
  return 0;
}
