h, w, la, lb, ka, kb = map(int, input().split()) ans = 1 << 60 if ka != 0: ans = min(ans, (h * w + ka - 1) // ka) if kb != 0: ans = min(ans, (h * w + kb - 1) // kb) b = 0 for a in range(h, -1, -1): while b < w: cnt = min(h, a * la) * min(w, b * lb) + a * ka + b * kb if cnt >= h * w: break b += 1 cnt = min(h, a * la) * min(w, b * lb) + a * ka + b * kb if cnt >= h * w: ans = min(ans, a + b) print(ans)