no-stories-any-more

Have you ever wished to be given a direct problem statement in the contest? Do you hate the boring stories that problem setters write...starting from “john was going on a trip”…passing with “blablabla”…and ending with “kindly help John J”. We all know that there is no John so why wasting contestants time. As we were contestants and know that feeling very well, we decided to break that boring way and save your time…

So, here is the question

There are n elements in a set. Some elements might be related to 0 elements in the set , some might be related to 1 element in the set and so on...
What you need to do is remove all elements which are related to exactly 0 elements then remove all elements which are related to exactly 1 elements in the remaining set and repeat the process till n-1 elements. 

Note : 
1. If a is related to b, b is also related to a.
2. If A is related to only one element say B, and B has realation with A and C then while removing all elements which are related to exactly 1 elements A will be removed and after that B will have only one relation i.e with C, but you can't remove B then beause you will remove all elements which are realted to exactly 2 elements in your next iteration.

You need to print the maximum number of elements that can be left in the set after N-1 iterations.

Input 
N ( number of test cases) followed by N lines each line contains number of elements in a set

Output
N lines (maximum number of elements that can be left in the set.)

Constraints
0<N<100000
0<N<100000

SAMPLE INPUT
2
1
3

SAMPLE OUTPUT
0
1

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions: