// import java.util.*; public class Main_sol2 { private static final int INF = (int)(1e9); public static void main(String[] args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(), w = sc.nextInt(), la = sc.nextInt(), lb = sc.nextInt(); long ka = sc.nextLong(), kb = sc.nextLong(); sc.close(); int amx = (h+la-1) / la, bmx = (w+lb-1) / lb, res = INF; for (int acnt=0; acnt<=amx; ++acnt) { long alen = Math.min(h, acnt*la), adda = acnt * ka; int lval = -1, rval = bmx + 1; while (rval-lval > 1) { int cval = rval - (rval-lval) / 2; long blen = Math.min(w, cval*lb), addb = cval * kb; if (alen*blen+adda+addb < (long)h*w) lval = cval; else rval = cval; } if (rval <= bmx) res = Math.min(res, acnt+rval); } System.out.println(res); } }