a topsecret military base command Colonel Zuev expect inspection Ministry Defence According charter topsecret military base include topsecret troop tell exactly secret troop end the problem Zuevs base miss topsecret troop reasonsThe colonel decide deal problem immediately order line single line n soldier base entrust Zuev know loquacity ith soldier leave equal qi Zuev want form topsecret troop k leftmost soldier line want total loquacity small possible troop remain topsecret to achieve go choose pair consecutive soldier swap he intend s time Note soldier participant swap number time the problem turn unusual colonel Zuev ask helpdetermine minimum total loquacity k soldier line achieve perform s swap consecutive soldier