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>=c:
  if x<=y:
    print(c*2*y)
  else:
    print((x-y)*a+c*2*y)
elif a>=c and b<c:
  if y<=x:
    print(c*2*x)
  else:
    print((y-x)*b+c*2*x)
elif a>=c and b>=c:
  if x>=y:
    print(c*2*x)
  else:
    print(c*2*y)