a, b, c, x, y = [int(x) for x in input().split()]

if a + b < c*2:
    res = a*x + b*y
else:
    min_c = min(x, y)
    max_c = max(x, y)
    diff = max_c - min_c
    odd = min_c % 2
    res = (min_c * 2) * c + (diff-odd)*max(a, b)

print(res)