A, B, C, An, Bn = list(map(int, input().split()))
ABh = (A+B)//2
abx = 0
pay = 0
if ABh > C and not min(A, B)>C*2:
    abx = min(An, Bn)
    pay = abx*C*2
    if An-abx>0:
        pay += (An-abx)*A
    elif Bn-abx>0:
        pay += (Bn-abx)*B
elif ABh <= C:
    pay = A*An+B*Bn

else:
    pay = C*max(An, Bn)*2
    
print(pay)