A, B, C, X, Y = map(int, input().split())
ave_ab = (A + B) / 2
count_a = 0
count_b = 0
count_ab = 0
if C <= A and C<= B:
    max_num = X if X >= Y else Y
    while count_ab / 2 != max_num:
        count_ab += 1
    print(C * count_ab)
    exit()

if ave_ab > C:
    while count_ab / 2 != X and count_ab / 2 != Y:
        count_ab += 1
    count_a = count_ab / 2
    count_b = count_ab / 2
    add_count_a, add_count_b = 0, 0
    while count_a + add_count_a != X:
        add_count_a += 1
    while count_b + add_count_b != Y:
        add_count_b += 1
    print(A * add_count_a + B * add_count_b + C * count_ab)
else:
    print(A * X + B * Y)