# -*- coding: utf-8 -*-
a, b, c, x, y = map(int, input().split())

total = a * x + b * y

if total > 2 * c * max(x, y):
  total = 2 * c * max(x, y)
elif a + b > 2 * c:
  diff_price_a_and_b = a + b - 2 * c
  total -= diff_price_a_and_b * min(x, y)
print(total)
