*n* people came to a party. Then those, who had no friends among people at the party, left. Then those, who had exactly 1 friend among those who stayed, left as well. Then those, who had exactly 2, 3, ..., *n* - 1 friends among those who stayed by the moment of their leaving, did the same.

What is the maximum amount of people that could stay at the party in the end?
The first input line contains one number *t* — amount of tests (1 ≤ *t* ≤ 10<sup class="upper-index">5</sup>). Each of the following *t* lines contains one integer number *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>).
for i in range(int(input())):
	x = int(input())
	print(x-2) if x > 1 else print(0)



"""

13650
75286
30210
88013
60892
80139
99039
96207
91262
93728
94969
50862
75649
84158
72706
38038
68743
14427
93785
83980
73072
83384
90179
75096
98089
87572
51724
62754
45354
74461
25776
17497
95260
51238
38407
4397
96838
95121
70480
74127
98990
73672
50743
85573
39267
81780
79854
17313
98785
56419
86120
88816
98001
88355
98103
9065
84254
87470
78802
77742
59299
29533
55655
68861
97254
98838
93303
56598
17484
58002
44062
75202"""