Problem: IOI Real Estate rents condominiums. The apartment room handled by this company is 1LDK, and the area is 2xy + x + y as shown in the figure below. However, x and y are positive integers.


Figure_Madori


In the IOI real estate catalog, the areas of condominiums are listed in ascending order (in ascending order), but it was found that some mistakes (those with an impossible area) were mixed in this.

The catalog (input file) has N + 1 lines, the number of rooms is written in the first line, and the area is written in ascending order, one room per line in the following N lines. However, the number of rooms is 100,000 or less, and the area is (2 to the 31st power) -1 = 2,147,483,647 or less. Up to 3 of the 5 input data have 1000 rooms or less and an area of ​​30000 or less.

Output the wrong number of lines (the number of impossible rooms).

In the output file, also include a line feed code on the last line of the output.





Examples

Input

10
4
7
9
10
12
13
16
17
19
20


Output

2


Input

None


Output

None

Solution (in CPP):

Solution:
#include <iostream>
#include <vector>
#include <cstring>

using namespace std;

typedef long long ll;

int N;

bool isPrime[(1<<16)+1];
vector<ll> primes;
void init() {
    memset(isPrime, -1, sizeof(isPrime));
    isPrime[0] = isPrime[1] = false;
    for (ll i = 2; i <= (1<<16); i++) {
        if (isPrime[i]) {
            primes.push_back(i);
            for (ll j = i + i; j <= (1<<16); j += i) {
                isPrime[j] = false;
            }
        }
    }
}

bool valid(ll n) {
    // n = 2xy + x + y
    // 2*n+1 = (2x+1)(2y+1) -- (1)
    // 与えられたnについて(1)を満たすようなx,y(x, y > 0)が存在するかどうか
    //
    // 2*n+1が素数であるかどうかを判定すればいい. 素数ならありえないnである.
    n = 2 * n + 1;
    for (int i = 0; i < primes.size() && primes[i] * primes[i] <= n; i++) {
        if (n % primes[i] == 0) return true;
    }
    return false;
}

int main() {
    cin >> N;
    int ans = 0;
    init();
    for (int i = 0; i < N; i++) {
        ll n; cin >> n;
        if (!valid(n)) ans++;
    }
    cout << ans << endl;
    return 0;
}