

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

#print(A,B,C,X,Y)

ans = (int(A) + int(B)) * int(X+Y)
for i in range(0,100001,2):
  tmp = int(C) * i + int(A) * max(int(X)-i//2,0) + int(B) * max(int(Y)-i//2,0)
  ans = min(ans,tmp)

print(ans)