def resolve():
    a, b, c, x, y = map(int, input().split())

    if a+b > 2*c:
        com = min(x, y)
        ans = 2*c*com
        if 2*c < a or 2*c < b:
            ans += max(x-com, y-com)*2*c
        elif x > y:
            ans += a*(x-com)
        else:
            ans += b*(y-com)
    else:
        ans = a*x + b*y

    print(ans)