a = list(map(int,input().split()))

bo = True
if a[0]+a[1] < a[2]*2:
    bo = False
if a[3] > a[4]:
    if bo == True:
        price = a[2]*a[4]*2 + (a[3]-a[4])*a[0]
    else:
        price = a[0]*a[3]+a[1]*a[4]
else:
    if bo == True:
        price = a[2]*a[3]*2 + (a[4]-a[3])*a[1]
    else:
        price = a[0]*a[3]+a[1]*a[4]
print(price)