a,b,c,x,y=map(int,input().split())
ans=0
if c < (a+b)//2:
  cnt=0
  while x>0 and y>0:
    x-=0.5
    y-=0.5
    cnt+=1
  ans+=c*cnt
if c < a//2 and x:
  ans+=c*x*2
elif c<b//2 and y:
  ans+=c*y*2
else:
  ans+=a*x
  ans+=b*y

