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
import org.omg.CORBA.*;

import java.lang.Object;
import java.util.*;
import java.io.*;

public class TaskD {

    void solve() throws IOException {
        int t = in.nextInt();
        for (int i = 0; i < t; ++i) {
            out.println(Math.max(in.nextInt() - 2, 0));
        }
    }

    static FastReader in;
    static PrintWriter out;
    static PrintStream err;

    public static void main(String[] args) throws IOException {
        try {
            in = new FastReader();
            out = new PrintWriter(System.out);
            err = System.err;
            new TaskD().solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

}

class FastReader {
    private StringTokenizer st;
    private BufferedReader br;

    public FastReader() {
        this(System.in);
    }

    public FastReader(InputStream ps) {
        br = new BufferedReader(new InputStreamReader(ps));
    }

    public FastReader(String filename) throws FileNotFoundException {
        this(new FileInputStream(filename));
    }

    public String nextToken() throws IOException {
        while (st == null || !st.hasMoreElements()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}