a, b, c,x,y = map(int, input().split())

total = a*x+b*y
if a/2 + b/2 > c:
    if a > c and b > c:
        total = max(x,y)*2*c
    elif a < c and x >y:
        total = y*2*c+ round(x-y)*a
    elif b < c and y >x:
        total = x*2*c+ round(y-x)*b


print(total)