Here's an horrible drawing that tries to explain what I'm asking:
$n$-sided polygons arranged so that their centers are the vertices of a square. The square is exactly as large as the diameter of the smallest circle enclosing each polygon. The polygons do not overlap. Polygons are oriented so that each one has either exactly two sides in common or exactly one side and one vertex in common with the other shapes.">
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$?