a = input().split()
money = 0
pizza = int(a[3])
pizzb = int(a[4])

if int(a[2])>int(a[0]) or int(a[2])>int(a[1]):
  
  if pizza<pizzb:
    while pizza<pizzb:
      money += int(a[1])
      pizzb -= 1
  elif pizza > pizzb:
    while pizza > pizzb:
      money += int(a[0])
      pizza -= 1

  if int(a[0])+int(a[1]) < int(a[2])*2:
    while pizza > 0:
      money += int(a[0])
      money += int(a[1])
      pizza -= 1
  elif int(a[0])+int(a[1]) > int(a[2])*2:
    while pizza > 0:
      money += int(a[2])*2
      pizza -= 1
      
else:
  m = max(pizza, pizzb)
  money = m*2*int(a[2])
  
print(money)