Question 52
Let $S_{7}$ denote all the permutations of $1,2, \ldots, 7$. For any $\pi \in S_{7}$, let $f(\pi)$ be the smallest positive integer $i$ such that $\pi(1), \pi(2), \ldots, \pi(i)$ is a permutation of $1,2, \ldots, i$. Compute $\sum_{\pi \in S_{7}} f(\pi)$.