A, B, C, X, Y = map(int, input().split())
total = 0
ans = 10**10

for i in range(0, max(X, Y)*2, 2):
  total = A*(X-(i/2)) + B*(Y-(i/2)) + C*i
  print(total)
  ans = min(ans, total)
  
print(int(ans))