#include using namespace std; using ll = long long; int main() { int a, b, c, d, ans = 0; cin >> a >> b >> c >> d; if (1 + c > d) { cout << 0 << endl; } else { while (a > 0 && b >= c) { ans++; b -= c; a--; } cout << ans << endl; } }