Computing depth from number of defined names