a, b, c, x, y = map(int, input().split())

na, nb, nc = x, y, 0
mx = 10**18
for i in range(max(x,y)):
  if i%2==1: continue
  total = a*(na-i//2) + b*(nb-i//2) + c*i
  if total<mx:
    mx=total

print(mx)