#include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int maxb = d / (1 + c); int ans = min(a, maxb); cout << ans << endl; }