// import java.util.*; public class Main_sol1 { 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, bcnt = bmx + 1, res = INF; for (int acnt=0; acnt<=amx; ++acnt) { int alen = Math.min(h, acnt*la); long adda = acnt * ka; while (bcnt > 0) { int blen = Math.min(w, (bcnt-1)*lb); long addb = (bcnt-1) * kb; if ((long)alen*blen+adda+addb < (long)h*w) break; --bcnt; } if (bcnt <= bmx) res = Math.min(res, acnt+bcnt); } System.out.println(res); } }