#include "bits/stdc++.h" #define Rep(i,n) for(int i=0;i> a(n,vector(m,0)); using namespace std; typedef long long ll; typedef pair P; template inline bool chmax(T& a, T b) {if(a inline bool chmin(T& a, T b) {if(a>b){a=b;return 1;}return 0;} int a,b,c,d; int main(){ cin >> a >> b >> c >> d; int res = 0; while(a>0&&b>=c&&d>c){ res++; a--; b-=c; d-=1+c; } put(res); return 0; }