#include using namespace std; //ループ系マクロ #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REP2(i, s, n) for (ll i = s; i < (ll)n; i++) #define REP3(v, A) for(auto v: A) #define REP4(It, A) for (ll It=A.begin();It!=A.end();++It) #define REP5(i, n) for (ll i = 0; i * i < (ll)(n); i++) //vector系マクロ #define ALL(A) A.begin(), A.end() #define RALL(A) A.rbegin(), A.rend() #define SORT(A) sort(ALL(A)) #define RSORT(A) sort(RALL(A)) //入力系マクロ #define GET(A) cin >> A #define GETV(i,n,A) REP(i,n)cin >> A[i] //出力系マクロ #define print(A) cout << A << endl #define YeNo(bo) print(((bo) ? "Yes":"No")) #define YENO(bo) print(((bo) ? "YES":"NO")) #define yeno(bo) print(((bo) ? "yes":"no")) #define LISTOUT(A) rep(i,A.size())cout << A[i] << " ";cout << endl //雑処理系マクロ #define PB push_back #define IS insert #define SZ size #define TE true #define FE false #define Fir first #define Sec second //定数系マクロ #define I_MAX 2147483647 #define I_MIN -2147483647 #define UI_MAX 4294967295 #define LL_MAX 9223372036854775807 #define LL_MIN -9223372036854775808 #define ULL_MAX 18446744073709551615 //型宣言系マクロ using ll = long long; using ull =unsigned long long; using P = pair; using vll = vector; using vvll = vector; using vc = vector; //using mint = modint998244353; //デバッグ系マクロ #ifdef _DEBUG #define debug(x) cerr << "dbg: "<< #x << ": " << x << endl #define debug_v(x) cerr << "dbg_vec: " << #x << ": "; REP3(v,x) cerr << v << " "; cerr << endl #define debug_s(x) cerr << "dbg_set: " << #x << ": {"; REP3(v,x) cerr << v << ","; cerr << "}" << endl #define debug_m(x) cerr << "dbg_map: " << #x << ": "; REP4(Ite1,x)cerr << "key: " << Ite1->first << " : " << Ite1->second << " "; cerr<< endl #else #define debug(x) #define debug_v(x) #define debug_s(x) #define debug_m(x) #endif //関数系マクロ ll GCM(ll a,ll b){ if(b==0){ return a; } return GCM(b,b%a); } bool kaibuncheck(string S){ bool ret=TE; REP(i,S.SZ()/2){ if(S[i]!=S[S.SZ()-i-1]){ ret=FE; break; } } return ret; } vector> primefact(ll N){ vector> ret; REP5(i,N){ ll cot=0; if(N%i==0){ while(N%i==0){ cot++; N/=i; } ret.PB(make_pair(i,cot)); } } if(N!=1)ret.PB(make_pair(N,1)); return ret; } int main() { ll A,B,C,D;cin >> A >> B >> C >> D; cout << min(C/A,D/B) << endl; }