// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0590

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;

const int C = (int) 1e6;

bool isprime[C];
vector<int> prime;

void init() {
  fill(isprime, isprime+C, true);
  isprime[0] = isprime[1] = false;
  for (auto i=2; i<C; i++) {
    if (isprime[i]) {
      prime.push_back(i);
      for (auto j=2; ; j++) {
	int t = i*j;
	if (t >= C) break;
	isprime[t] = false;
      }
    }
  }
}

int main() {
  init();
  int N;
  cin >> N;
  int count = 0;
  for (auto i=0; i<N; i++) {
    long long n;
    cin >> n;
    long long S = 2*n+1;
    long long sq = (long long)sqrt(S);
    for (auto j=0; prime[j]<=sq; j++) {
      if (S%prime[j] == 0) {
	count++;
	break;
      }
    }
  }
  cout << N-count << endl;
}