#include using namespace std; using ll = long long; using pll = pair; #define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i) #define rep(i, n) drep(i, 0, n - 1) #define all(a) (a).begin(), (a).end() #define pb push_back #define fi first #define se second const ll MOD = 1000000007; const ll MOD2 = 998244353; const ll INF = 1LL << 60; const ll MAX_N = 2e5; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll h, w, la, lb, ka, kb; cin >> h >> w >> la >> lb >> ka >> kb; ll ans = INF; for(ll a=0; a<=10*((h+la-1)/la); a++){ if(a*ka >= h*w){ ans = min(ans, a); }else{ if(a*la*lb+kb==0) continue; ll b = (h*w-a*ka + min(a*la, h)*lb+kb-1)/(min(a*la, h)*lb+kb); ans = min(ans, a+b); } } cout << ans << endl; }