a, b, ab, x, y = map(int, input().split())
if a+b <= 2*ab:
    print(a*x+b*y)
    exit()
if a >= 2*ab and b >= 2*ab:
    print(max(x,y)*2*ab)
    exit()
mix = min(x,y)*2*ab
f = lambda x, y: a if x - y >= 0 else b
print(mix+f(x, y)*abs(x-y))