If there are 27 posts, then there are (n - 1) total spaces between the posts . . . 27 - 1 = 26 total spaces (since there has to be a post at each end of the line)
Here's an example of 7 posts equally spaced . . . so you can see there are one less spaces between posts than there are posts (i.e. 6 total spaces between 7 posts) . . .