#include using namespace std; int main() { int a, b, c, d, cnt; cin >> a >> b >> c >> d; cnt = 1; while (true) { if (a >= cnt || b >= cnt * c || d >= cnt + cnt * c) { cnt++; } else { cout << cnt - 1 << endl; } } return 0; }