A, B, AB, an, bn = map(int, input().split())
if AB*2 < A+B:
    if AB*2 < min(A, B):
        print(AB*max(an, bn)*2)
    else:
        if an < bn:
            print(B*(bn-an) + AB*min(an, bn)*2)
        else:
            print(A*(an-bn) + AB*min(an, bn)*2)
else:
    print(A*an+B*bn)