A, B, C, X, Y = map(int, input().split())
ans = 1e1000
for i in range(X):
  for j in range(Y):
    for k in range(0, X+Y, 2):
      if i+k/2==X and j+k/2==Y:
        ans = min(ans, A*i+B*j+C*k)
print(ans)