A, B, C, X, Y = map(int, input().split())
sum = 0
min_num = 10**10
num = [0]*3
if min(A/2, B/2) > C:
    print(C*Y*2)
    exit()
for c in range(min(X, Y)+1):
    sum += C*c*2
    num[0] = c*2
    for a in range(X-c):
        sum += A
        num[1] = a
    for b in range(Y-c):
        sum += B
        num[2] = b
    if min_num > sum:
        min_num = sum
    print(sum, num)
    sum = 0
print(min_num)