#include <bits/stdc++.h>
using namespace std;
int main() {
  int cnt = 0;
  int n, m;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> m;
    a[i] = m;
  }
  for (int i = 2; i < n; i++) {
    if ((i == 2 || i == 3 || i == 5 || i == 7) ||
        (i % 2 != 0 && i % 3 != 0 && i % 5 != 0 && i % 7 != 0)) {
      cnt++;
    }
  }
  cout << cnt;
}
