About 300. Most were just small city-states, though.
City states is not quite teh correct word. I mean, there were city states, the Free Imperial Cities, but this tendency to name all very small states city states is... misleading. Most were in fact tiny lordships and counties, with a handful of villages each, and not even much in the way of cities

Those really tiny states didnt even make up a large part of the territory of the Empire, but since they were so small they did make up the majority of the statelets...