Here's an horrible drawing that tries to explain what I'm asking:
Trying this with small numbers gives me $f: 4 \to 0, 6 \to 4, 8 \to 4, 10 \to 8, 12 \to 8.$ This suggests that $$f(2n) = 4 \times \left( \lceil \frac{2n}{4} \rceil - 1 \right), 2n > 4.$$
Can this result be extended for $n \to \infty$? Bonus: What about odd values of $n$?