# -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 12:25:45 2020

@author: black
"""

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


a_num = 0
b_num = 0
c_num = 0


ans = 10**10
if 2*C < 2*P_MIN:
    a_num = 0
    b_num = 0
    c_num = MAX*2
    ans = A*a_num + B*b_num + C*c_num
    
else:
    for i in range(X+1):
        for j in range(Y+1):
            for k in range(max(X,Y)):
                if i+k>=X and j+k>=Y:
                    a_num = i
                    b_num = j
                    c_num = k*2
                    total = A*a_num + B*b_num + C*c_num
                    ans = min(total, ans)

print(ans)
