LevelCount returns the number of levels within a dimension.
Rules and TurboIntegrator
Version 11 and 12
LevelCount(dimension, hierarchy)