[a,b,c,x,y] = [int(i) for i in input().split()]

ans = a * x + b * y
cnt = 1
while x != 0 or y != 0:
    x = max(x - 2, 0)
    y = max(y - 2, 0)
    ans = min(ans,a*x+b*y+c*4*cnt)
    cnt += 1
print(ans)