#include <bits/stdc++.h>
using namespace std;
int n, a[100];
void input() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
}
void output() {
  for (int i = 0; i < n; i++) {
    if (a[i] <= 2)
      cout << a[i];
    else if (a[i] <= 4)
      cout << a[i] - 1;
    else
      cout << a[i] / 2 + 1;
    cout << endl;
  }
}
int main() {
  input();
  output();
}
