a = list(map(int,input().split()))
ans = 0
ans1 = 0
flag = 0
if (a[0] > a[2])&(a[1] >a[2]):
    ans1 = (max(a[3],a[4]))*2*a[2]
    flag = 1
if (a[0]+a[1]) > 2*a[2]:
    ans += a[2]*(min(a[3],a[4]))*2
    if (a[3]-a[4]) < 0:
        ans += (a[4] - a[3])*a[1]
    else:
        ans += (a[3] - a[4])*a[0]
else:
    ans += a[0]*a[3] +a[1]*a[4]
if flag == 1:
    print(ans1)
else:
    print(ans)