A,B,C,X,Y = map(int,input().split())
X_piza = X
Y_piza = Y
minimum = 10**20
for i in range(0,10**5+2,2):
  if minimum>C*2*i+max(0,X-i)*A+max(0,Y-i)*B:
    minimum = C*2*i+max(0,X-i)*A+max(0,Y-i)*B
print(minimum)