a, b, c, x, y = map(int, input().split())
if a<c and b< c:
  print(a*x+b*y)
elif a< c and b*2>=c*2:
  if x<=y:
    print(c*2*y)
  else:
    print((x-y)*a+c*2*y)
elif a*2>=c*2 and b*2<c*2:
  if y<=x:
    print(c*2*x)
  else:
    print((y-x)*b+c*2*x)
elif a*2>=c*2 and b*2>=c*2:
  if x>=y:
    print(c*2*x)
  else:
    print(c*2*y)