counts number of levels/layers in the map as well