#-*-coding:utf-8-*-

def main():
    A, B, C, X, Y = list(map(int, input().split()))

    dp = [[0 for i in range(Y+1)] for j in range(X+1)]


    
    for i in range(X+1):
        for j in range(Y+1):
            if i == 0 and j > 0:
                dp[i][j] = min(dp[i][j-1]+B, dp[i][j-1]+2*C)
            elif i > 0 and j == 0:
                dp[i][j] = min(dp[i-1][j]+A, dp[i-1][j]+2*C)
            elif i > 0 and j > 0:
                dp[i][j] = min(dp[i-1][j]+A, dp[i-1][j]+2*C, dp[i][j-1]+B, dp[i][j-1]+2*C, dp[i-1][j-1]+2*C)
    
    #for i  in range(X+1):
        #print(dp[i])
        
    print(dp[-1][-1])
                




if __name__ == '__main__':
    main()