a,b,c,x,y=map(int,input().split())

ans=0
if a+b>2*c:
  if 2*c<a and 2*c<b:
    for i in range(1,2*max(x,y)+1):
      ans+=c
  else:
    for i in range(1,2*min(x,y)+1):
      ans+=c
    for i in range(1,max(x,y)-min(x,y)+1):
      if x>y:
        ans+=a
      else:
        ans+=b
else:
  for i in range(1,x+1):
    ans+=a
  for i in range(1,y+1):
    ans+=b
print(ans)