def main(): try: import pypyjit pypyjit.set_param('max_unroll_recursion=-1') except: pass try: import sys sys.setrecursionlimit(10**7) except: pass from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum import heapq from bisect import bisect_left, bisect_right import copy from collections import deque,Counter,defaultdict from itertools import permutations,combinations from decimal import Decimal,ROUND_HALF_UP #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP) from functools import lru_cache, reduce #@lru_cache(maxsize=None) from operator import add,sub,mul,xor,and_,or_ INF = 10**18 mod1 = 10**9+7 mod2 = 998244353 #DecimalならPython H,W,La,Lb,Ka,Kb = map(int, input().split()) ans = INF if Ka == 0 and Kb == 0: pass elif Ka == 0: ans = (H*W+Kb-1)//Kb elif Kb == 0: ans = (H*W+Ka-1)//Ka else: ans = min((H*W+Ka-1)//Ka, (H*W+Kb-1)//Kb) for i in range(H+1): l = 0 h = W+H+1 tmp = min(i*La,H) while h-l > 1: m = (l+h)//2 if tmp*min(m*Lb,W) + i*Ka + m*Kb >= H*W: h = m else: l = m ans = min(ans, h+i) print(ans) if __name__ == '__main__': main()