For a positive integer $n,$ let $P_n$ be the set of sequences of $2n$ elements, each $0$ or $1,$ where there are exactly $n$ $1$’s and $n$ $0$’s. I choose a sequence uniformly at random from $P_n.$ Then, I partition this sequence into maximal blocks of consecutive $0$’s and $1$’s. Define $f(n)$ to be the expected value of the sum of squares of the block lengths of this uniformly random sequence. What is the largest integer value that $f(n)$ can take on?

Let's think step by step and output the final answer within \boxed{}.
user