#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
vector<int> a;
bool use[10000010];
int pr[10000010];
int get(int a) {
  if (a == pr[a]) return a;
  return pr[a] = get(pr[a]);
}
void unite(int a, int b) {
  int l = get(a), r = get(b);
  if (rand() & 1)
    pr[l] = r;
  else
    pr[r] = l;
}
int gcd(int a, int b) {
  if (a == 0 || b == 0) return a + b;
  return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < 10000010; i++) pr[i] = i;
  a.resize(n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a.begin(), a.end());
  vector<int>::iterator it1, it2, it3;
  for (int y = 1; y * y <= a[n - 1] / 2 + 1; y++)
    for (int x = y + 1; x * x <= 3 * a[n - 1] / 2 + 1; x++) {
      if (gcd(x * x - y * y, 2 * x * y) != 1 ||
          gcd(x * x + y * y, 2 * x * y) != 1 ||
          gcd(x * x - y * y, x * x + y * y) != 1 ||
          x * y * 2 == x * x - y * y || x * y * 2 == x * x + y * y)
        continue;
      it1 = lower_bound(a.begin(), a.end(), x * x - y * y);
      if (it1 != a.end() && *it1 != x * x - y * y) it1 = a.end();
      it2 = lower_bound(a.begin(), a.end(), 2 * x * y);
      if (it2 != a.end() && *it2 != 2 * x * y) it2 = a.end();
      it3 = lower_bound(a.begin(), a.end(), x * x + y * y);
      if (it3 != a.end() && *it3 != x * x + y * y) it3 = a.end();
      if (it1 != a.end() && it2 != a.end()) unite(*it1, *it2);
      if (it3 != a.end() && it2 != a.end()) unite(*it2, *it3);
      if (it1 != a.end() && it3 != a.end()) unite(*it1, *it3);
    }
  int ans = 0;
  for (int i = 0; i < n; i++)
    if (!use[get(a[i])]) {
      ans++;
      use[get(a[i])] = true;
    }
  cout << ans;
  return 0;
}
