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? 

Input

The first input line contains one number t — amount of tests (1 ≤ t ≤ 105). Each of the following t lines contains one integer number n (1 ≤ n ≤ 105).

Output

For each test output in a separate line one number — the maximum amount of people that could stay in the end.

Examples

Input

1
3


Output

1
//package javaapplication1;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
public class Main {
    public static class Box{
     private static int Index;   
     private static long a;
     private static long o;
      private static String sum;
        public Box(long aa,long oo, int i) {
            this.a=aa;
            this.o=oo;
            this.sum=String.valueOf(this.a+this.o);
            this.Index=i+1;
        }

        public static String getSum() {
            return sum;
        }

        public static int getIndex() {
            return Index;
        }
          
        @Override
        public String toString() {
            return this.sum;
        }
        
    }
    public static void main(String[] args) throws IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw=new PrintWriter(System.out);
        Scanner s=new Scanner(System.in);
        int t=Integer.parseInt(br.readLine());
        int []n=new int[t];
        
        for (int i = 0; i < t; i++) {
             n[i]=Integer.parseInt(br.readLine());
        }
        for (int i = 0; i < t; i++) {
            if(n[i]>1)
            System.out.println(n[i]-2);
           else
            System.out.println(0);
        
        }
        
    }

}