def solve(a,b,c,x,y):
  k_max = min(x,y)
  l = []
  for i in range(k_max+1):
    s = a*(min(x-i,0))+b*(min(y-i,0))+c*i*2
    l.append(s)
  return min(l)   

A,B,C,X,Y = map(int,input().split())
print(solve(A,B,C,X,Y))