Get RPN tree size

I’ve implemented the following ‘tree sizer’ but it fails under certain conditions, the example below returns size 2 when it should return size 4, can anyone help me out. I’ve written this several …