#include using namespace std; typedef long long ll; int main(){ ll H, W, LA, LB, KA, KB; cin >> H >> W >> LA >> LB >> KA >> KB; ll ans = H + W + 1; for (ll i = 0; i <= H; i++){ for (ll j = 0; j <= W; j++){ ll tate = min(H, LA * i); ll yoko = min(W, LB * j); ll ka_sum = KA * i; ll kb_sum = KB * j; if (ka_sum + kb_sum >= H * W - tate * yoko){ ans = min(ans, i + j); } } } cout << ans << endl; }