a,b,c,x,y = map(int,input().split())
d = min(x//2,y//2)*2

if a*x+b*y > 2*max(x,y)*c:
    print(2*max(x,y)*c)
    exit()
if 2*d*c + a*(x-d) +b*(y-d)<=a*x+b*y:
    print(2*d*c + a*(x-d) +b*(y-d))
else:
    print(a*x+b*y)