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

"""
ABピザの購入数(0~(X+Y)で全探索)
"""
min_price = 10 ** 10
for i in range((X+Y)+1):
    c_price = C * i
    a_price = A * (X - i//2)
    b_price = B * (Y - i//2)
    min_price = min(min_price, a_price+b_price+c_price)
print(min_price)
