[a,b,c,x,y] = [int(i) for i in input().split()]

ans = a * x + b * y
cnt = 1
if x == 1 and y == 1:
  print(min(a+b,2 * c))
else:
  while x != 0 or y != 0:
      x = max(x - 2, 0)
      y = max(y - 2, 0)
      ans = min(ans,a*x+b*y+c*4*cnt)
      cnt += 1
  print(ans)