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 java.io.*;
import java.util.*;

public class Main implements Runnable
{
  Scanner in;
  PrintWriter out; //= new PrintWriter(System.out);

  public static void main(String[] args) throws FileNotFoundException, IOException
  {
    new Thread(new Main()).start();
  }

  public class Pair
  {
    public long last;
    public long count;
    public int L;
    Pair(long l, long c) {last = l; count = c;}
    Pair(long l, long c, int L) {last = l; count = c; this.L = L;}
  }

  public void run()
  {
    final String name = "B-small";
    //try {
      in = new Scanner(System.in);// (new File(name + ".in"));//StreamTokenizer(new FileReader(new File(name + ".in")));
      out = new PrintWriter(System.out); // new PrintWriter(new File(name + ".out")); //= new PrintWriter(System.out);
    //} catch (IOException e) {}


    int n = in.nextInt();

    for (int i = 0; i < n; ++i)
        out.println(Math.max(0, in.nextInt() - 2));
    
    out.flush();
  }

}
