from itertools import permutations N, K, X = map(int, input().split()) A = list(map(int, input().split())) max_ = -100000000000 i = 1 while i <= N: L = set(permutations(A[:i], min(i, K))) for l in L: max_ = max(sum(l) - i * X, max_) i += 1 print(max_)