Forum Moderators: open
All search engines are using an indexer to analyse pages. Once a page is analised, it is quite easy to sort them using different keys. Pages with duplicate or near duplicate content can be automatically flagged and filtered out of the index this way. More on this here : How search engines work. A primer. [webmasterworld.com]
Some people think it is safer to keep at least 8 % to 13 % of difference between pages with near duplicate content. Changing just a city name in some template page is an old spam technique that search engines are fighting by this mean.
Mac is correct, the reason why there are duplicate issues to be concerned about is that search engines might view this as trying to spamming their index, even if in cases like you described it is perfectly legitimate.
And yes - SEs do count words and analyze. After all that is part of the ranking proces anyway.