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