Counting Hierarchies: Polynomial Time and Constant