A,B,C,X,Y = map(int,input().split())
cnt_A = X
cnt_B = Y
cnt_C = 0
ans = []
for _ in range(X+Y):
    if 2*C<=A+B:
        cnt_C += 2
        cnt_A -= 1
        cnt_B -= 1
    ans.append(cnt_A*A+cnt_B*B+cnt_C*C)
    if ((cnt_A<0) or (cnt_B<0)) or ((cnt_C==2*X)or(cnt_C ==Y*22)):
        break  
ans.sort()
print(ans[0])