Counting Leaf nodes frontend