A,B,C,X,Y = map(int,input().split())
C2 = C//2
if C*2 <= min(A,B):
  print(max(X,Y)*C*2)
elif C*2 >= A + B:
  print(A*X+B*Y)
else:
  out = min(X,Y)*C*2
  if max(X,Y) == X:
    out += A*(X-Y)
  else:
    out += B*(Y-X)
  print(out)