def main():
    a, b, c, x, y = map(int, input().split())
    d = [a, b]
    i, j = max(x, y), min(x, y)
    n = i // 2 * 2
    f = i == x
    if 2 * c * n > (a + b) * n:
        ans = a * x + b * y
    else:
        ans = c * 2 * n + (i % 2 == 1) * min(2 * c, d[not f])

    print(ans)


if __name__ == '__main__':
    main()
