If the mean of the distribution is \(5\), then the value of \(P\) is:
\[ \begin{array}{|c|c|c|c|c|c|} \hline x_i & 2 & 4 & 6 & P & 10 \\ \hline f_i & 3 & 2 & 1 & 4 & 2 \\ \hline \end{array} \]