The question should be phrased as two distinct ones:
1) How many ships would an organization like Starfleet need to administer the area its stated to cover in practical terms?
2) How many ships can be deduced to exist from on-screen evidence?
I think the answer to those two questions is quite different.
Regarding smaller ships not being considered "ships", I think DS9 reliably resolved that conundrum via the runabouts. And there are just as small ships in the real world that are still designated as fully commissioned naval vessels (though this is
rare in larger navies). However, given the established role (or rather, multirole capabilities) of the Danube class, they may very well be exceptions for ships that small.
Additionally, the Nash (DS9) establishes that something as simple as a transport can
still be a fully commissioned starship.
By the way, just for reference, there are ~2,500-3,000 warships on Earth total. There are tens of thousands of other support vessels used by world navies and governments. I'd guess that breakdown would work for the UFP as well, given their FTL capabilities. (this is in regards to question 1)