prc_A, prc_B, prc_C, piz_A, piz_B = [int(i) for i in input().split()]

answer = 0

if prc_A + prc_B >= prc_C*2:
    piz_tmp = min(piz_A, piz_B)
    answer = prc_C*2*piz_tmp
    piz_A = piz_A - piz_tmp
    piz_B = piz_B - piz_tmp

if prc_A >= prc_C*2:
    if prc_B >= prc_C*2:
        answer += prc_C*2*max(piz_A, piz_B)
    else:
        answer += prc_C*piz_A*2
        if piz_A < piz_B:
            answer = answer + (piz_B - piz_A)*prc_B
else:
    if prc_B >= prc_C*2:
        answer = prc_C*piz_B*2
        if piz_A > piz_B:
            answer = answer + (piz_A - piz_B)*prc_A
    else:
        answer += prc_A*piz_A+prc_B*piz_B

print(answer)