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:
  if C*2 >= A and C*2 >= B:
    print(A*X+B*Y)
    print("C")
  else:
    if max(A,B) ==A:
      out = X*C*2
      if Y-X >=0:
        print(out+B*(Y-X))
    else:
      out = Y*C*2
      if X-Y >=0:
        print(out+A*(X-Y))
else:
  out = min(X,Y)*C*2
  if max(X,Y) == X:
    out += A*(X-Y)
  else:
    out += B*(Y-X)
  print(out)