Count balanced tree