a,b,c,x,y = map(int,input().split())
c = c*2
n = max(x,y)
ans = 10**25
for i in range(10**6):
    x1,y1 = i,i
    p = c*i
    if x > x1:
        if y > y1:
            p += a*(x-x1) + b*(y-y1)
        else:
            p += a*(x-x1)
    else:
        if y > y1:
            p += b*(y+y1)
    if ans > p:
        ans = p

print(ans)