#include using namespace std; #define ll long long #define endl "\n" #define rep(i, a, n) for (int i = a; i < n; ++i) int main() { int a, b, c, d; cin >> a >> b >> c >> d; cout << min(a, min(b /c, d / (c + 1))) << endl; return 0; }