A, B, C, X, Y = map(int, input().split())

K = 2 * C - A - B
S = A*X + B*Y
t =(-1 * S )/ K
z = min(X, Y, t)
Z = max(X, Y)

if K >= 0:
  print(S)
elif S > Z*C*2:
  print(Z*C*2)
else:
  P =S + K* z
  print(P)