A beacon network is a binary tree. Beacons on the same tier share the same depth (the root is at depth 0). Report the largest number of beacons found on any single tier. Only actual beacons are counted; missing positions do not count.
Input format
Line 1: an integer k, the number of tokens on line 2.
Line 2: k space-separated tokens giving the tree in level order. The first token is the root; each subsequent token is an integer id or null for a missing child. Children of null nodes are omitted.
Output format
A single integer: the maximum number of beacons on any tier.
Constraints
- The tree has between 1 and 2000 nodes (the root is always present).
- Each id is between -1000000 and 1000000.