#include <bits/stdc++.h>
using namespace std;
int judge(int n) {
  if (n == 1 || n == 2 || n == 3) return 1;
  if (n % 2 == 0 || n % 3 == 0)
    return 0;
  else
    return 1;
}
int main(void) {
  int n;
  int ans = 0;
  while (cin >> n) {
    ans += judge(n);
  }
  cout << ans << endl;
  return 0;
}
