cost_a,cost_b,cost_ab,num_a,num_b = map(int,input().split())
if num_a > num_b:
  num_ab = num_b * 2
  need_a = num_a - (num_ab // 2)
  if need_a < 0:
    need_a = -need_a
  cost1 = need_a * cost_a + num_ab * cost_ab
elif num_a < num_b:
  num_ab = num_a * 2
  need_b = num_b - (num_ab // 2)
  if need_b < 0:
    need_b = -need_b
  cost1 = need_b * cost_b + num_ab * cost_ab
else:
  num_ab = num_b * 2  
  cost1 = num_ab * cost_ab
cost2 = cost_a * num_a + cost_b * num_b
if cost1 > cost2:
  print(cost2)
else:
  print(cost1)

