# coding: utf-8
# Your code here!
a,b,c,x,y = map(int,input().split())

if c*2 > a+b :
    print(x*a+y*b)
else:
    minpizza=min(x,y)
    if c <= a and c <= b:
        print(2*c*max(x,y))
    elif c >= a and max(x,y)==x:
        print(minpizza*c*2 + a*(x-minpizza)+b*(y-minpizza))
    elif c >= b and max(x,y)==y:
        print(minpizza*c*2 + a*(x-minpizza)+b*(y-minpizza))
    else:
        print("NotImplemented")