a,b,c,x,y=map(int,input().split())
xx=x-x%2
yy=y-y%2
ans=0
if max(a,b)<c:
  ans+=a*xx+b*yy
elif a+b<=2*c<=2*b:
  ans+=(a+b)*min(xx,yy)+[2*c*(yy-xx),a*(xx-yy)][xx>yy]
elif a+b<=2*c<=2*a:
  ans+=(a+b)*min(xx,yy)+[2*c*(xx-yy),b*(yy-xx)][yy>xx]
elif 2*c<a+b<2*b:
  ans+=2*c*min(xx,yy)+[2*c*(yy-xx),a*(xx-yy)][xx>yy]
elif 2*c<a+b<2*a:
  ans+=2*c*min(xx,yy)+[2*c*(xx-yy),b*(yy-xx)][yy>xx]
else:
  ans+=2*c*max(xx,yy)
if xx<x and yy<y:
  ans+=[2*c,a+b][2*c>a+b]
elif xx<x:
  ans+=[2*c,a][2*c>a]
elif yy<y:
  ans+=[2*c,b][2*c>b]
print(ans)