A,B,AB,AX,BY = map(int,input().split())

sum = 0
if A >= AB*2 and B >= AB*2:
    while AX >0 and BY >0:
        AX -=1
        BY -=1
        sum += AB*2
    if AX>=1:
        sum += AB*2*AX
    elif BY>=1:
        sum += AB*2*BY
    
elif (A+B) >= AB*2:
    while AX >0 and BY >0:
        AX -=1
        BY -=1
        sum += AB*2
    print(sum)
    if AX>=1 or BY>=1:
        sum += A*AX+B*BY
else:
        sum += A*AX+B*BY
print(sum)
