How to count a number of leaf nodes in a given binary tree?