cost_a,cost_b,cost_ab,num_a,num_b = map(int,input().split())
num = max(num_a,num_b)
cost1 = num * 2 * cost_ab
cost2 = cost_a * num_a + cost_b * num_b
if cost1 > cost2:
  print(cost2)
else:
  print(cost1)