#include <bits/stdc++.h>
using namespace std;
int gcm(int x, int y) {
  int dai = x > y ? x : y;
  int sho = x > y ? y : x;
  int ama;
  while (sho) {
    ama = dai % sho;
    dai = sho;
    sho = ama;
  }
  return dai;
}
int main(int argc, const char* argv[]) {
  int n, cnt = 0;
  cin >> n;
  while (n--) {
    int c;
    cin >> c;
    if (c == 2 || gcm(2, c) == 1) {
      cnt++;
      continue;
    }
  }
  cout << cnt << endl;
  return 0;
}
