#include
using namespace std;
// n no of student appear in exam
// m no of coupons bhaiya has
// x minimum coupons rquired to get 100 schlorship
// y coupons paid by the students who failed in exam
// nget students who didn’t get scholarship
int Scholarship(int n,int m,int x,int y){
int s=0,e=n;
int final_ans=0;
while(s<=e){
int mid=(s+e)/2;
int nget=n-mid;
int total_Coupons=m+nget*y;
int total_schol_req=mid*x;
if(total_schol_req<=total_Coupons){
final_ans=mid;
s=mid+1;
}
else{
e=mid-1;
}
}
return final_ans;
}
int main(){
int n,m,x,y;
cin>>n>>m>>x>>y;
cout<<Scholarship(n,m,x,y);
return 0;
}