A,B,C,X,Y=map(int,input().split())
if A>=2*C:
  if B>=2*C:
    print(2*C*max(X,Y))
    exit()
  else:
    print(2*C*X+B*max(0,(Y-X)))
    exit()
elif B>=2*C:
  print(2*C*Y+A*max(0,(X-Y)))
  exit()
else:
  ans=A*X+B*Y
  for p in range(X):
    for q in range(Y):
      r=max(2*(X-p),2*(Y-q))
      ans=min(ans,A*p+B*q+C*r)
  print(ans)