pa,pb,pab,a,b=list(map(int,input().split()))
S1=pa*a+pb*b
S2=2*pab*max(a,b)
if S1>S2:
  print(S2)
else:
  if pa+pb>pab*2:
    print(2*pab*min(a,b)+pa*(a-min(a,b))+pb*(b-min(a,b)))
  else:
    print(S1)
    