A permutation $(a_1, a_2, a_3, \dots, a_{2012})$ of $(1, 2, 3, \dots, 2012)$ is selected at random. If $S$ is the expected value of 
		\[
		\sum_{i = 1}^{2012} | a_i - i |,
		\]
		then compute the sum of the prime factors of $S$.

[i]Proposed by Aaron Lin[/i]