#include <bits/stdc++.h>
using namespace std;
const int N = 50001;
const int M = 1e9 + 7;
vector<int> isprime(1e6 + 1, 1);
vector<int> primes;
void sieve() {
  isprime[0] = isprime[1] = 0;
  for (int i = 2; i * i <= 1e6; i++) {
    if (isprime[i]) {
      for (int j = i * i; j <= 1e6 + 1; j += i) {
        isprime[j] = 0;
      }
    }
  }
}
void get_primes() {
  sieve();
  for (int i = 3; i <= 1e6; i++)
    if (isprime[i]) primes.push_back(i);
}
int bs(long long int n) {
  n -= (n % 2 == 0);
  long long int l = 1;
  long long int h = n;
  while (h - l > 0) {
    long long int mid = l + (h - l) / 2;
    mid -= ((mid & 1) == 0);
    if (mid < 0) return 1;
    if (mid * mid == n) return mid;
    if (mid * mid > n)
      h = mid - 2;
    else
      l = mid + 2;
  }
  h -= (h % 2 == 0);
  l -= (l % 2 == 0);
  if (h * h <= n)
    return h;
  else if (l * l <= n)
    return l;
  return l - 2;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t;
  cin >> t;
  get_primes();
  while (t--) {
    int n;
    cin >> n;
    if (n < 4) {
      cout << n << "\n";
      continue;
    }
    if (n <= 8) {
      cout << (n + 1 - (n % 2 == 0)) / 2 << "\n";
      continue;
    }
    int x1 = upper_bound(primes.begin(), primes.end(), n) - primes.begin();
    int x2 = upper_bound(primes.begin(), primes.end(), bs(n)) - primes.begin();
    cout << x1 - x2 + 1 << "\n";
  }
  return 0;
}

### Prompt

Your task is to create a CPP solution to the following problem:

In number world, two different numbers are friends if they have a lot in common, but also each one has unique perks.

More precisely, two different numbers a and b are friends if gcd(a,b), (a)/(gcd(a,b)), (b)/(gcd(a,b)) can form sides of a triangle.

Three numbers a, b and c can form sides of a triangle if a + b > c, b + c > a and c + a > b.

In a group of numbers, a number is lonely if it doesn't have any friends in that group.

Given a group of numbers containing all numbers from 1, 2, 3, ..., n, how many numbers in that group are lonely?

Input

The first line contains a single integer t (1 ≤ t ≤ 10^6) - number of test cases.

On next line there are t numbers, n_i (1 ≤ n_i ≤ 10^6) - meaning that in case i you should solve for numbers 1, 2, 3, ..., n_i.

Output

For each test case, print the answer on separate lines: number of lonely numbers in group 1, 2, 3, ..., n_i.

Example

Input


3
1 5 10


Output


1
3
3

Note

For first test case, 1 is the only number and therefore lonely.

For second test case where n=5, numbers 1, 3 and 5 are lonely.

For third test case where n=10, numbers 1, 5 and 7 are lonely.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int N = 50001;
const int M = 1e9 + 7;
vector<int> isprime(1e6 + 1, 1);
vector<int> primes;
void sieve() {
  isprime[0] = isprime[1] = 0;
  for (int i = 2; i * i <= 1e6; i++) {
    if (isprime[i]) {
      for (int j = i * i; j <= 1e6 + 1; j += i) {
        isprime[j] = 0;
      }
    }
  }
}
void get_primes() {
  sieve();
  for (int i = 3; i <= 1e6; i++)
    if (isprime[i]) primes.push_back(i);
}
int bs(long long int n) {
  n -= (n % 2 == 0);
  long long int l = 1;
  long long int h = n;
  while (h - l > 0) {
    long long int mid = l + (h - l) / 2;
    mid -= ((mid & 1) == 0);
    if (mid < 0) return 1;
    if (mid * mid == n) return mid;
    if (mid * mid > n)
      h = mid - 2;
    else
      l = mid + 2;
  }
  h -= (h % 2 == 0);
  l -= (l % 2 == 0);
  if (h * h <= n)
    return h;
  else if (l * l <= n)
    return l;
  return l - 2;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t;
  cin >> t;
  get_primes();
  while (t--) {
    int n;
    cin >> n;
    if (n < 4) {
      cout << n << "\n";
      continue;
    }
    if (n <= 8) {
      cout << (n + 1 - (n % 2 == 0)) / 2 << "\n";
      continue;
    }
    int x1 = upper_bound(primes.begin(), primes.end(), n) - primes.begin();
    int x2 = upper_bound(primes.begin(), primes.end(), bs(n)) - primes.begin();
    cout << x1 - x2 + 1 << "\n";
  }
  return 0;
}

```