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

    ans = a*x + b*y

    for i in range(x):
        num = a*i
        a_diff = x - i
        for j in range(y):
            c_max = max(a_diff, y-j)
            num += b*j + (c*2*c_max)
            ans = min(num, ans)

    print(ans)

if __name__ == '__main__':
    resolve()