Brachylog, 18 bytes
{hl⟦kp;?z₀∋₍ᵐ+}ᶠot
###Explanation
Explanation
ot The output is the biggest result of…
{ }ᶠ …finding all outputs to the following predicate:
hl⟦k Construct the range [0, …, n-1]
p Take a permutation of that range
;?z₀ Zip that permutation with the Input, stopping when all elements of
the input are used (important because the range is possibly
bigger than the length of the input)
∋₍ᵐ In each element of the zip, take the head'th element of the tail
+ Sum the result