In computer science, a binary search tree (BST) is a binary tree data structure which has the following properties:
Look at above, this is a a binary search tree of size 9 and depth 3, with root 8 and leaves 1, 4, 7 and 13.
Now, given a lot of integers, please build a binary search tree in order, Can you tell me how many leaves at last?
The input will contain several test cases. Each testcase begins with an integer N(1≤n≤50000), and the second line are N disparate integers.
The leaves of the tree.