A,B,C,X,Y = map(int,input().split())

if 2*C<A and 2*C<B:
    ans=C*(2*max(X,Y))
    print(ans)
    exit()

ans=10**10
for i in range(0,2*min(X,Y)+1,2):#ABピザを買う枚数を２枚ずらしで全探索
    tmp = A*(X-0.5*i) + B*(Y-0.5*i) + C*i
    ans=min(ans,tmp)
print(int(ans))