Helper to count level