https://www.acmicpc.net/problem/16917
a,b,c,x,y=map(int,input().split()) num1=a*x+b*y k=x if x>=y else y num2=k*2*c min1=min(num1,num2) w=2*c if a+b>=2*c else a+b v=y if x>=y else x x-=v y-=v num3=v*w+x*a+y*b min1=min(min1,num3) print(min1)