Let $a_{1}, a_{2}, \ldots, a_{n}$ be the natural numbers $1,2, \ldots, n$ arranged in some order. Determine the maximum value of the sum

$$
\left|a_{1}-1\right|+\left|a_{2}-2\right|+\ldots+\left|a_{n}-n\right|
$$

when all possible arrangements are considered.