A, B, C, X, Y = map(int, input().split())
pa = A * X
pb = B * Y
pab = pa + pb
if C == min(A, B, C):
    price = C * max(X, Y) * 2
    print(price)
elif (A + B) / 2 == C:
    pc = C * max(X, Y) * 2
    if pab < pc:
        print(pab)
    else:
        print(pc)
elif (A + B) / 2 < C:
    price = pab
    print(price)
else:
    print(0)