I have heard either 38 or 39, and googling it gives me both answers. Which is it?
There were ten states in West-Germany and 14 districts in the East. West- and East-Berlin had a special status.
Not sure where you got that high of a number. There were about that many after the German Confederation, but many ceased to exist by the time of the 1871 unification or were part of Austria who did not participate.
There were 27 according to my reckoning, if you include the Imperial Territory of Alsace-Lorraine.