#include #include int main() { //std::ifstream inf("Text.txt"); std::cin.rdbuf(inf.rdbuf()); int A, B, C, D; std::cin >> A >> B >> C >> D; int ans = D / (1 + C); if (B < C) { std::cout << "0" << std::endl; } else if(ans <= A) { std::cout << ans << std::endl; } else { std::cout << A << std::endl; } return 0; }