Little Ashish is doing internship at multiple places. Instead of giving parties to his friends he decided to donate candies to children. He likes solving puzzles and playing games. Hence he plays a small game. Suppose there are children. The rules of the game are:
The child gets candies ().
The child cannot get a candy until and unless all the children before him () gets candies according to rule number .
One of his jealous friends, Pipi, asks him "Given (the number of candies) how many children will you be able to serve?". Little Ashish fears calculations and cannot solve this problem so he leaves this problem to the worthy programmers of the world. Help little Ashish in finding the solution.
The first line contains i.e. number of test cases.
lines follow, each line containing an integer .
For each testcase, print the output that little Ashish wants in one line.
Note: If the child doesn't get number of candies then it's not counted as a successful donation
For . Only the child can get the candy (i.e. candy) and no other child.
For . Both the ( candies) and the ( candies) children can get the candies.
For . Since the child will get only 8 candies following the rule it won't be counted as a successful donation. Only the and the children can get 1 and 4 candies respectively.