#include using namespace std; int main(){ long A, B, C, D; cin >> A >> B >> C >> D; long ans{min({A, B / C, D / (1 + C)})}; cout << ans << endl; return 0; }