#include using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; int n = 0; for (int i = 1; i < a+1; i++) { if ((i * c) <= b) { if ((i * c + i) <= d) { n = i; } } else { break; } } cout << n << endl; }