#include #include #include int main() { int a, b, c, d; std::cin >> a >> b >> c >> d; int nori = a == 0 ? std::numeric_limits::max() : c / a; int housa = b == 0 ? std::numeric_limits::max() : d / b; int result = std::min(nori, housa); std::cout << result << std::endl; return 0; }