import sys
read = sys.stdin.read
readlines = sys.stdin.readlines

def main():
    a, b, c, x, y = map(int, input().split())
    r = float('inf')
    for piza_a in range(x + 1):
        for piza_b in range(y + 1):
            piza_c = max(x - piza_a, y - piza_b) * 2
            tmp = piza_a * a + piza_b * b + piza_c * c
            r = min(r, tmp)
    print(r)

if __name__ == '__main__':
    main()