
A,B,C,X,Y=map(int,input().split())
ans=A*X+B*Y+C*(X+Y)
for i in range(X):
    for j in range(Y):
        for k in range(2*max(X,Y)):
            if i+k*0.5>=X and j+k*0.5>=Y:
                nedan=A*i+B*j+C*k
                if nedan<ans:
                    ans=nedan
print(ans)