#include <iostream>
#include <math.h>
using namespace std;

int main(int argc, char *argv[]) {
  int n, x, count = 0;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> x;

    if (!(x % 2)) {
      bool flag = true;
      for (int j = 3; i < sqrt(x); j += 2) {
        if (!(x % j)) {
          flag = false;
          break;
        }
      }
      if (flag)
        count++;
    }
  }

  cout << count << endl;
}

//
//
//  prime.cpp - created by us162022
//
#include <iostream>
#include <math.h>
using namespace std;

int main(int argc, char *argv[]) {
  int n, x, count = 0;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> x;

    if (x % 2) {
      bool flag = true;
      for (int j = 3; j <= sqrt(x); j += 2) {
        if (!(x % j)) {
          flag = false;
          break;
        }
      }

      if (flag)
        count++;

    }

    else {
      if (x == 2)
        count++;
    }
  }

  cout << count << endl;
}


#include <iostream>
#include <vector>

using namespace std;

bool isPrimeNumber(int n) {
  if (n < 2)
    return false;

  bool notExists = true;
  for (int i = 2; i < n / 2 + 1 && notExists; i++)
    notExists = n % i != 0;

  return notExists;
}

int main() {
  int n, count = 0, tmp;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (isPrimeNumber(tmp))
      count++;
  }

  cout << count << endl;
  return 0;
}

#include <complex>
#include <iostream>

using namespace std;

bool isPrimeNumber(int n) {
  if (n == 2)
    return true;

  if (n < 2 || n % 2 == 0)
    return false;

  int i = 3;
  while (i <= sqrt(n))
    if (n % i == 0)
      return false;
    else
      i += 2;

  return true;
}

int main() {
  int n, count = 0, tmp;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (isPrimeNumber(tmp))
      count++;
  }

  cout << count << endl;
  return 0;
}


#include <cmath>
#include <iostream>
#include <vector>
#define MAX 100000000
bool prime[MAX + 1];
int main() {
  int n, count = 0;
  int i, j;
  std::cin >> n;

  for (i = 0; i <= MAX; i++) {
    prime[i] = true;
  }
  prime[0] = false;
  prime[1] = false;

  for (i = 2; i <= std::sqrt(MAX) + 1; i++) {
    if (prime[i]) {
      for (int j = i * i; j <= MAX; j += i)
        prime[j] = false;
    }
  }

  for (int i = 0; i < n; i++) {
    int x;
    std::cin >> x;
    if (prime[x]) {
      count++;
    }
  }
  std::cout << count << std::endl;
}

#include <cmath>
#include <iostream>

bool isPrime(int n) {
  for (int i = 2; i <= std::sqrt(n); i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}

int main() {
  int n, count = 0;
  int x;
  std::cin >> n;

  for (int i = 0; i < n; i++) {
    std::cin >> x;
    if (isPrime(x) == true) {
      count++;
    }
  }
  std::cout << count << std::endl;
}


#include <iostream>

using namespace std;

int main() {
  int i, j, n, c, count = 0, number[10000];

  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> number[i];
    c = 0;
    for (j = 2; j <= number[i] / 2; j++) {
      if (number[i] % j == 0) {
        c++;
      }
      if (c != 0) {
        break;
      }
    }
    if (c == 0) {
      count++;
    }
  }
  cout << count << endl;

  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;

int main() {
  int i, c, j, n, count = 0, number[10000];

  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> number[i];
    c = 0;
    for (j = 1; j <= sqrt(number[i]); j++) {
      if (number[i] % j == 0) {
        c++;
      }
    }
    if (c == 1) {
      count++;
    }
  }
  cout << count << endl;

  return 0;
}


#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

// ---------------------
// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                                               \\
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"                       \\
       << " " << __FILE__ << endl;

// ---------------------
#define INF 922337203685477580
#define IINF (1 << 21)
typedef long long ll;

int main() {
  int N;
  cin >> N;
  // ll q[N];
  ll q[10100];
  ll maximum = 0;

  REP(i, N) {
    cin >> q[i];
    maximum = max(maximum, q[i]);
  }

  // int table[maximum + 1];
  int table[12000];
  REP(i, 12000) {
    table[i] = 1; // possibly prime number
  }
  table[0] = 0;
  table[1] = 0;

  for (ll base = 2; base <= 10100; base++) {
    if (!table[base])
      continue;
    for (ll p = 2; base * p <= 10100; p++) {
      // dump(base * p);
      table[base * p] = 0;
    }
  }

  ll sum = 0;
  REP(i, N) {
    sum += table[q[i]];

    if (q[i] < 10100) {
    } else {
      for (ll base = 2; base <= 10000; base++) {
        if (q[i] % base == 0) {
          sum++;
          break;
        }
      }
    }
  }
  //
  // REP(i, 100) {
  //   // dump(table[i]);
  //   if (i) cout << " ";
  //   cout << table[i];
  // }

  cout << sum << endl;
  return 0;
}

#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

// ---------------------
// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                                               \\
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"                       \\
       << " " << __FILE__ << endl;

// ---------------------
#define INF 922337203685477580
#define IINF (1 << 21)
typedef long long ll;

int main() {
  int N;
  cin >> N;
  // ll q[N];
  ll q[10100];
  ll maximum = 0;

  REP(i, N) {
    cin >> q[i];
    maximum = max(maximum, q[i]);
  }

  // int table[maximum + 1];
  int table[12000];
  REP(i, 12000) {
    table[i] = 1; // possibly prime number
  }
  table[0] = 0;
  table[1] = 0;

  for (ll base = 2; base <= 10100; base++) {
    if (!table[base])
      continue;
    for (ll p = 2; base * p <= 10100; p++) {
      // dump(base * p);
      table[base * p] = 0;
    }
  }

  ll sum = 0;
  REP(i, N) {
    // dump(i);

    if (q[i] < 10100) {
      sum += table[q[i]];
    } else {
      int ok = 1;
      for (ll base = 2; base <= 10000 && base * base <= q[i]; base++) {
        if (q[i] % base == 0) {
          ok = 0;
          break;
        }
      }
      if (ok)
        sum++;
    }
  }
  //
  // REP(i, 100) {
  //   // dump(table[i]);
  //   if (i) cout << " ";
  //   cout << table[i];
  // }

  cout << sum << endl;
  return 0;
}


#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
using namespace std;

#define MAX 256

int f(int x) {
  if (x == 2)
    return 1;
  if (x % 2 == 0)
    return 0;
  for (int i = 3; i <= x / 2; i += 2) {
    if (x % i == 0)
      return 0;
  }
  return 1;
}

int main(void) {

  int a;
  scanf("%d", &a);
  int count = 0, b;

  for (int i = 0; i < a; i++) {
    scanf("%d", &b);
    count += f(b);
  }

  printf("%d\\n", count);

  return 0;
}

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>
using namespace std;

#define MAX 256

int f(int x) {
  if (x == 2)
    return 1;
  if (x % 2 == 0)
    return 0;
  for (int i = 3; i <= (int)sqrt(x); i += 2) {
    if (x % i == 0)
      return 0;
  }
  return 1;
}

int main(void) {

  int a;
  scanf("%d", &a);
  int count = 0, b;

  for (int i = 0; i < a; i++) {
    scanf("%d", &b);
    count += f(b);
  }

  printf("%d\\n", count);

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define reps(i, f, n) for (int i = (f); i <= (n); ++i)
#define outl(x) cout << (x) << '\\n'
#define FAST() cin.tie(0), ios::sync_with_stdio(false)
template <class A, class B> inline bool chmax(A &a, B b) {
  return b > a ? a = b, 1 : 0;
}
template <class A, class B> inline bool chmin(A &a, B b) {
  return b < a ? a = b, 1 : 0;
}
inline int updiv(int a, int b) { return ((a + b - 1) / b); }

bool prime(int n) {
  if ((n & 1) == 0)
    return (n == 2);
  for (int i = 3; i < n; i += 2) {
    if (n % i == 0)
      return (false);
  }
  return (true);
}

int main() {
  FAST();
  int n, a, cnt = 0;
  cin >> n;
  while (n--) {
    cin >> a;
    cnt += prime(a);
  }
  outl(cnt);
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define reps(i, f, n) for (int i = (f); i <= (n); ++i)
#define outl(x) cout << (x) << '\\n'
#define FAST() cin.tie(0), ios::sync_with_stdio(false)
template <class A, class B> inline bool chmax(A &a, B b) {
  return b > a ? a = b, 1 : 0;
}
template <class A, class B> inline bool chmin(A &a, B b) {
  return b < a ? a = b, 1 : 0;
}
inline int updiv(int a, int b) { return ((a + b - 1) / b); }

bool prime(int n) {
  if ((n & 1) == 0)
    return (n == 2);
  for (int i = 3; i * i <= n; i += 2) {
    if (n % i == 0)
      return (false);
  }
  return (true);
}

int main() {
  FAST();
  int n, a, cnt = 0;
  cin >> n;
  while (n--) {
    cin >> a;
    cnt += prime(a);
  }
  outl(cnt);
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int isprime(int x) {
  if (x == 2)
    return true;
  if (x < 2 || x % 2 == 0)
    return false;
  else {
    int i = 3;
    while (i < sqrt(x)) {
      if (x % i == 0)
        return false;
    }
    return true;
  }
}

int main() {
  int n;
  cin >> n;
  int a[n], b;
  b = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (isprime(a[i]) != 0) {
      b++;
    }
  }
  cout << b << endl;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int isprime(int x) {
  if (x == 2)
    return true;
  if (x < 2 || x % 2 == 0)
    return false;
  else {
    int i = 3;
    while (i <= sqrt(x)) {
      if (x % i == 0)
        return false;
      i = i + 2;
    }
    return true;
  }
}

int main() {
  int n;
  cin >> n;
  int a[n], b;
  b = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (isprime(a[i]) != 0) {
      b++;
    }
  }
  cout << b << endl;
}


#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <utility>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; ++i)

int main() {
  int ans = 0;
  int n;
  vector<bool> isprime(100000004);
  for (int i = 0; i < isprime.size(); ++i) {
    isprime[i] = true;
  }
  isprime[0] = isprime[1] = false;

  for (int i = 2; i < isprime.size(); i++) {
    if (!isprime[i]) {
      continue;
    }
    for (int j = i * 2; j < isprime.size(); j += i) {
      isprime[j] = false;
    }
  }
  /*for (int i = 0; i<10004; i++) {
          cout << i;
          cout << " ";
          cout << (isprime[i] ? "YES" : "NO") << endl;
  }*/

  cin >> n;
  rep(i, n) {
    int u;
    cin >> u;
    if (isprime[u]) {
      ++ans;
    }
  }
  cout << ans << endl;
  return 0;
}

#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int n, x, c;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int j = 2; j <= (int)sqrt(x); j++) {
      if (x % j == 0) {
        c++;
        break;
      }
    }
  }
  cout << n - c << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;

  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;

    for (int j = 2; j < a; j++) {
      if (a % j == 0) {
        cnt++;
        break;
      }
    }
  }

  cout << n - cnt << endl;

  return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;

  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;

    int t = sqrt(a);
    for (int j = 2; j <= t; j++) {
      if (a % j == 0) {
        cnt++;
        break;
      }
    }
  }

  cout << n - cnt << endl;

  return 0;
}


#include <iostream>
using namespace std;

bool isDivisible(int a, int b) {
  if (a % b == 0)
    return true;
  else
    return false;
}

int main(int argc, char const *argv[]) {
  int n, m, count = 0;
  bool flag;
  cin >> n;
  for (int i = 0; i < n; i++) {
    flag = true;
    cin >> m;
    for (int j = m - 1; j > 1; j--) {
      if (isDivisible(m, j)) {
        flag = false;
        break;
      }
    }
    if (flag)
      count++;
  }
  cout << count << endl;
  return 0;
}

#include <iostream>
using namespace std;

int isPrime(int n) {
  int i;
  if (n < 2)
    return 0;
  else if (n == 2)
    return 1;
  if (n % 2 == 0)
    return 0;
  for (i = 3; i <= n / i; i += 2) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}

int main() {
  int n, m, count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    if (isPrime(m))
      count++;
  }
  cout << count << endl;
  return 0;
}


#include <iostream>
using namespace std;

int counter = 0;

void isPrime(int num) {
  int i = 2;
  while (1) {
    if (num % i == 0)
      break;
    i++;
  }
  if (i == num)
    counter++;
  return;
}

int main() {
  int N;
  cin >> N;
  int num;
  for (int i = 0; i < N; i++) {
    cin >> num;
    isPrime(num);
  }
  cout << counter << endl;
}

#include <cmath>
#include <iostream>
#include <stdio.h>
using namespace std;

int counter = 0;

void isPrime(int num) {
  int i = 2, limit = sqrt(num);
  while (i <= limit) {
    if (num % i == 0)
      return;
    i++;
  }

  counter++;
  return;
}

int main() {
  int N;
  cin >> N;
  int num;
  for (int i = 0; i < N; i++) {
    scanf("%d", &num);
    isPrime(num);
  }
  cout << counter << endl;
}


#include <stdio.h>
int main() {
  int n, temp, ans = 0;
  bool prime[1000001];
  for (int i = 0; i < 1000001; i++)
    prime[i] = true;
  for (int i = 4; i < 1000001; i += 2)
    prime[i] = false;
  for (int i = 3; i < 1001; i += 2) {
    if (prime[i]) {
      for (int j = i * i; j < 1000001; j += i)
        prime[j] = false;
    }
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &temp);
    if (prime[temp])
      ans++;
  }
  printf("%d\\n", ans);
}

#include <stdio.h>
int main() {
  bool f;
  int n, temp, ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &temp);

    f = true;
    if (temp % 2 == 0 && temp >= 4)
      f = false;
    for (int j = 3; j * j <= temp && f; j += 2)
      if (temp % j == 0)
        f = false;
    if (f)
      ans++;
  }
  printf("%d\\n", ans);
}


#include <algorithm>
#include <iostream>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

int main() {
  const int N_max = 10000;

  int N;
  int candidates[N_max];
  std::vector<int> primes;

  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> candidates[i];
  }
  int max_candidate = *std::max_element(candidates, candidates + N);

  // list
  for (int cand = 2; cand <= max_candidate; ++cand) {
    bool is_a_prime = true;
    for (const int &i : primes) {
      if (0 == cand % i) {
        is_a_prime = false;
        break;
      }
    }
    if (is_a_prime) {
      primes.push_back(cand);
    }
  }

  // count
  int num_of_primes = 0;
  for (int i = 0; i < N; ++i) {
    if (std::binary_search(primes.begin(), primes.end(), candidates[i])) {
      ++num_of_primes;
    }
  }
  cout << num_of_primes << endl;

  return 0;
}

#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

int main() {
  const int N_max = 10000;

  int N;
  int candidates[N_max];
  std::vector<int> primes;

  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> candidates[i];
  }
  int max_candidate = *std::max_element(candidates, candidates + N);
  int sqrt_max_candidate = static_cast<int>(sqrt(max_candidate));
  // cout << "max_candidate: " << max_candidate << endl;
  // cout << "sqrt_max_candidate: " << sqrt_max_candidate << endl;

  // list
  for (int cand = 2; cand <= sqrt_max_candidate; ++cand) {
    bool is_a_prime = true;
    for (const int &i : primes) {
      if (0 == cand % i) {
        is_a_prime = false;
        break;
      }
    }
    if (is_a_prime) {
      primes.push_back(cand);
    }
    // if (cand % 10000==0){
    //   cout << "checked: " << cand << endl;
    // }
  }

  // for(const int &i : primes){
  //   cout << i << endl;
  // }

  // count
  int num_of_primes = 0;
  for (int i = 0; i < N; ++i) {
    if (candidates[i] <= sqrt_max_candidate &&
        static_cast<bool>(
            std::binary_search(primes.begin(), primes.end(), candidates[i]))) {
      ++num_of_primes;
    } else if (candidates[i] > sqrt_max_candidate) {
      bool is_a_prime = true;
      for (const int &p : primes) {
        if (0 == candidates[i] % p) {
          is_a_prime = false;
          break;
        }
      }
      if (is_a_prime)
        ++num_of_primes;
    }
  }
  cout << num_of_primes << endl;

  return 0;
}


#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef long long i64;
#define put(n) cout << (n) << "\\n"
#define FOR(i, num, N) for (int(i) = (num); (i) < (N); (i)++)
#define RFOR(i, num, N) for (int(i) = (num); (i) > (N); (i)--)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

void Erarosthenes(vector<int> num, int N) {
  vector<bool> prime_number(1e6, false);
  FOR(i, 2, 1e6) prime_number[i] = true;
  FOR(i, 2, 1e3) {
    if (prime_number[i]) {
      for (int j = 2; i * j < 1e6; j++) {
        prime_number[i * j] = false;
      }
    }
  }

  int ans = 0;

  FOR(i, 0, N) {
    if (prime_number[num[i]])
      ans++;
  }

  put(ans);
}

int main() {
  int N;
  cin >> N;
  vector<int> num(N);
  FOR(i, 0, N) cin >> num[i];
  Erarosthenes(num, N);
}

#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef long long i64;
#define put(n) cout << (n) << "\\n"
#define FOR(i, num, N) for (int(i) = (num); (i) < (N); (i)++)
#define RFOR(i, num, N) for (int(i) = (num); (i) > (N); (i)--)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

void Erarosthenes(vector<int> num, int N) {
  vector<bool> prime_number(1e8, false);
  FOR(i, 2, 1e8) prime_number[i] = true;
  FOR(i, 2, 1e4) {
    if (prime_number[i]) {
      for (int j = 2; i * j < 1e8; j++) {
        prime_number[i * j] = false;
      }
    }
  }

  int ans = 0;

  FOR(i, 0, N) {
    if (prime_number[num[i]])
      ans++;
  }

  put(ans);
}

int main() {
  int N;
  cin >> N;
  vector<int> num(N);
  FOR(i, 0, N) cin >> num[i];
  Erarosthenes(num, N);
}


#include <iostream>

using namespace std;

bool is_prime(long long x) {
  if (1 >= x) {
    return false;
  }

  for (long long i = 2; i < x; i++) {
    if (x % i == 0) {
      return false;
    }
  }

  return true;
}

int main() {
  int n, cnt = 0;
  long long tmp;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> tmp;

    if (is_prime(tmp)) {
      cnt++;
    }
  }

  cout << cnt << endl;

  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;

bool is_prime(long long x) {
  if (2 > x)
    return false;

  if (2 == x)
    return true;

  if (0 == x % 2)
    return false;

  double sqrt_num = sqrt(x);

  for (long long i = 3; i <= sqrt_num; i += 2) {
    if (0 == x % i)
      return false;
  }

  return true;
}

int main() {
  int n, cnt = 0;
  long long tmp;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> tmp;

    if (is_prime(tmp))
      cnt++;
  }

  cout << cnt << endl;

  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int N;
  int x;
  int count = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> x;
    for (int j = 2; j < x / 2 + 1; j++) {
      if (x != 2) {
        if (x % j == 0) {
          count++;
          break;
        }
      }
    }
  }
  cout << N - count << endl;
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int N;
  int x;
  int count = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> x;
    for (int j = 2; j * j <= x; j++) {
      if (x % j == 0) {
        count++;
        break;
      }
    }
  }
  cout << N - count << endl;
  return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAX = (int)1e8;
bool prime[MAX + 1];

int main() {
  fill(prime, prime + MAX + 1, 1);
  for (int i = 2; i <= MAX; i++) {
    if (prime[i]) {
      for (int k = 2; i * k <= MAX; k++) {
        prime[i * k] = 0;
      }
    }
  }
  int n;
  int a;
  int cnt = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    cnt += prime[a];
  }
  cout << cnt << endl;
}

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAX = (int)1e7;
bool prime[MAX + 1];

int main() {
  fill(prime, prime + MAX + 1, 1);
  for (int i = 2; i <= MAX; i++) {
    if (prime[i]) {
      for (int k = 2; i * k <= MAX; k++) {
        prime[i * k] = 0;
      }
    }
  }
  int n;
  int a;
  int cnt = 0;
  scanf("%d", &n);
  bool isPrime = 1;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    if (a <= (int)1e7) {
      cnt += prime[a];
    } else {
      int bd = sqrt(a) + 1;
      isPrime = 1;
      for (int i = 2; i <= bd; i++) {
        if (a % i == 0) {
          isPrime = 0;
          break;
        }
      }
      cnt += isPrime;
    }
  }
  cout << cnt << endl;
}


#include <algorithm>
#include <iostream>

using namespace std;

bool setPrime(int size, bool isPrime[]) {
  isPrime[0] = isPrime[1] = false;

  for (int i = 2; i < size; ++i) {
    isPrime[i] = true;
  }

  for (int i = 2; (i * i) < size; ++i) {
    if (!isPrime[i]) {
      continue;
    }

    for (int j = i + i; j < size; j += i) {
      isPrime[j] = false;
    }
  }
}

int main(void) {
  const int size = 100000001;
  int n, count = 0;
  bool *isPrime = new bool[size];

  setPrime(size, isPrime);

  cin >> n;

  for (int i = 0; i < n; ++i) {
    int p;

    cin >> p;

    if (isPrime[p]) {
      ++count;
    }
  }

  cout << count << endl;

  delete[] isPrime;

  return 0;
}

#include <algorithm>
#include <iostream>

using namespace std;

bool isPrime(int n) {
  if (n == 2) {
    return true;
  }
  if ((n & 1) == 0) {
    return false;
  }

  for (int i = 3; (i * i) <= n; i += 2) {
    if ((n % i) == 0) {
      return false;
    }
  }

  return (n != 1);
}

int main(void) {
  int n, count = 0;

  cin >> n;

  for (int i = 0; i < n; ++i) {
    int p;

    cin >> p;

    if (isPrime(p)) {
      ++count;
    }
  }

  cout << count << endl;

  return 0;
}


#include <iostream>

using namespace std;

bool isPrime(int x);

int main() {
  int n = 0;
  int a[10000] = {};
  int z = 0; // output

  cin >> n;
  for (int i = 0; i < 10000; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (isPrime(a[i]) == true) {
      z++;
    }
  }
  cout << z << endl;
}
bool isPrime(int x) {
  if (x <= 1)
    return false;
  for (int i = 2; i < x - 1; i++) {
    if (x == 2 || x == 3) {
      return true;
    }
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}

#include <iostream>
#include <math.h>

using namespace std;

bool isPrime(int x);

int main() {
  int n = 0;
  int a[10000] = {};
  int z = 0; // output

  cin >> n;
  for (int i = 0; i < 10000; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    if (isPrime(a[i]) == true) {
      z++;
    }
  }
  cout << z << endl;
}
bool isPrime(int x) {
  if (x == 2)
    return true;
  if (x < 2 || x % 2 == 0)
    return false;
  int i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0)
      return false;
    i = i + 2;
  }
  return true;
}


#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define REP(i, n) FOR(i, 0, n)
using namespace std;
typedef vector<int> vi;

int main() {
  int n;
  cin >> n;
  vi p(n);
  REP(i, n) cin >> p[i];
  int cnt = 0;
  REP(i, n) {
    bool flg = false;
    FOR(j, 2, p[i]) {
      if (p[i] % j == 0) {
        flg = true;
        break;
      }
    }
    if (!flg)
      cnt++;
  }
  cout << cnt << endl;
}


#include <iostream>
#include <math.h>
#include <string>
using namespace std;

int main() {
  int n, a[100000000], total = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] % 2 == 1 && a[i] > 0) {
      for (int j = 0; j < sqrt(a[i]); j++)
        if (a[i] % j == 0) {
          total++;
          break;
        }
    }
  }
  cout << total << endl;

  return 0;
}

#include <iostream>
#include <math.h>
using namespace std;

int main() {
  int n, a, total = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a % 2 == 1 && a > 0) {
      int k = sqrt(a);
      for (int j = 3; j <= k; j++)
        if (a % j == 0) {
          k = -1;
          break;
        }
      if (k != -1)
        total++;
    } else if (a == 2)
      total++;
  }
  cout << total << endl;

  return 0;
}


#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
#define fr first
#define sc second
#define INF 100000001
using namespace std;
bool Prime[INF] = {true, true};
int main() {
  for (int i = 3; i <= sqrt(INF); i += 2) {
    if (!Prime[i]) {
      for (int j = 3; i * j < INF; j += 2) {
        Prime[j * i] = true;
      }
    }
  }
  int n, a, cnt = 0;
  cin >> n;
  while (n--) {
    cin >> a;
    if (a == 2)
      cnt++;
    else if (a % 2 == 1 && !Prime[a])
      cnt++;
  }
  cout << cnt << endl;
}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
#define fr first
#define sc second
#define INF 100000001
using namespace std;
bitset<INF> Prime;
int main() {
  Prime[1] = true;
  for (int i = 3; i <= sqrt(INF); i += 2) {
    if (!Prime[i]) {
      for (int j = 3; i * j < INF; j += 2) {
        Prime[j * i] = true;
      }
    }
  }
  int n, a, cnt = 0;
  cin >> n;
  while (n--) {
    cin >> a;
    if (a == 2)
      cnt++;
    else if (a % 2 == 1 && !Prime[a])
      cnt++;
  }
  cout << cnt << endl;
}


#include <iostream>
using namespace std;

void MakePrimeArray(bool A[], int n) {
  A[0] = A[1] = false;
  for (int i = 2; i < n; i++) {
    A[i] = true;
  }

  for (int i = 2; i * i < n; i++) {
    if (A[i]) {
      for (int j = i * i; j < n; j += i) {
        A[j] = false;
      }
    }
  }
}

int main() {
  long int n = 10000000;

  bool *primearray = new bool[n];

  MakePrimeArray(primearray, n);

  int num;
  cin >> num;
  int input = 0;
  int solve = 0;
  for (int i = 0; i < num; i++) {
    cin >> input;
    if (primearray[input]) {
      solve++;
    }
  }
  cout << solve << endl;
  return 0;
}

#include <iostream>
using namespace std;

void MakePrimeArray(bool A[], int n) {
  A[0] = A[1] = false;
  for (int i = 2; i < n; i++) {
    A[i] = true;
  }

  for (int i = 2; i * i < n; i++) {
    if (A[i]) {
      for (int j = i * i; j < n; j += i) {
        A[j] = false;
      }
    }
  }
}

int main() {
  /*
  long int n=10000000;

  bool *primearray = new bool[n];

        MakePrimeArray(primearray,n);
*/
  int num;
  cin >> num;
  int input = 0;
  int solve = 0;
  for (int i = 0; i < num; i++) {
    cin >> input;
    /*if(primearray[input]){
      solve++;
    }*/
    if (input != 1) {
      for (int j = 2; j * j <= input; j++) {
        if (input % j == 0) {
          solve--;
          break;
        }
      }
      solve++;
    }
  }
  cout << solve << endl;
  return 0;
}


#include <bitset>
#include <iostream>
using namespace std;
int main() {
  std::bitset<10000> flg;
  int n;
  int primes = 0;
  for (int i = 2; i < 10000; i++) {
    if (!flg.test(i)) {
      for (int j = 2; i * j < 10000; ++j) {
        flg.set(i * j);
      }
    }
  }
  cin >> n;
  while (n-- > 0) {
    int x;
    cin >> x;
    if (!flg.test(x)) {
      primes++;
    }
  }
  cout << primes << endl;
}

#include <bitset>
#include <iostream>
using namespace std;
int main() {
  const int TMAX = 10000;
  std::bitset<TMAX> flg;
  int n;
  int primes = 0;
  for (int i = 2; i < TMAX; i++) {
    if (!flg.test(i)) {
      for (int j = 2; i * j < TMAX; ++j) {
        flg.set(i * j);
      }
    }
  }
  cin >> n;
  while (n-- > 0) {
    int x;
    cin >> x;
    if (x <= TMAX) {
      if (!flg.test(x)) {
        primes++;
      }
    } else {
      bool isnotprime = false;
      if ((x % 2) != 0) {
        for (int i = 3; i < TMAX; i += 2) {
          if (!flg.test(i)) {
            if ((x % i) == 0) {
              isnotprime = true;
              break;
            }
          }
        }
        if (!isnotprime) {
          primes++;
        }
      }
    }
  }
  cout << primes << endl;
}


#include <iostream>
using namespace std;

int arr[10005];

int tot = 0;
bool isprime(int);
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> arr[i];

  for (int i = 0; i < n; i++) {
    if (isprime(arr[i]))
      tot++;
  }

  cout << tot << endl;

  return 0;
}

bool isprime(int num) {
  if (num % 2 == 0 && num != 2)
    return false;
  for (int i = 3; i <= num / 2; i += 2) {
    if (num % i == 0)
      return false;
  }
  return true;
}

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

int arr[10005];

int tot = 0;
bool isprime(int);
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> arr[i];

  for (int i = 0; i < n; i++) {
    if (isprime(arr[i]))
      tot++;
  }

  cout << tot << endl;

  return 0;
}

bool isprime(int num) {
  if (num % 2 == 0 && num != 2)
    return false;
  for (int i = 3; i <= int(sqrt(double(num))); i += 2) {
    if (num % i == 0)
      return false;
  }
  return true;
}


#include <cmath>
#include <iostream>

bool isprime(long n) {
  if (n == 2)
    return true;
  if (n < 2)
    return false;
  double root_n = std::sqrt((double)n);
  for (int i = 2; i <= root_n; ++i)
    for (int j = i * i; j <= n; j += i)
      if (n % j == 0)
        return false;
  return true;
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  int n, a, cnt = 0;
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    std::cin >> a;
    if (isprime(a))
      ++cnt;
  }
  std::cout << cnt << std::endl;
}

#include <cmath>
#include <iostream>

bool isprime(long n) {
  if (n == 2)
    return true;
  if (n < 2 || n % 2 == 0)
    return false;
  double root_n = std::sqrt((double)n);
  for (int i = 3; i <= root_n; i += 2)
    if (n % i == 0)
      return false;
  return true;
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  int n, a, cnt = 0;
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    std::cin >> a;
    if (isprime(a))
      ++cnt;
  }
  std::cout << cnt << std::endl;
}


#include <iostream>
using namespace std;
int main() {

  int n, a, b, c = 0, d, e;

  cin >> n;

  for (int i = 0; i < n; i++) {

    cin >> a;

    b = 0;
    e = a % 2;

    if (e == 0 && a != 2)
      continue;

    if (a == 2) {
      c++;
    } else {

      for (int j = 1; j <= a / 2; j += 2) {

        d = a % j;

        if (d == 0) {
          b++;
        }
        if (b == 2)
          break;
      }

      if (b == 1) {
        c++;
      }
    }
  }

  cout << c << endl;

  return 0;
}

#include <cmath>
#include <iostream>
using namespace std;
int main() {

  int n, a, b, c = 0, d, e;

  cin >> n;

  for (int i = 0; i < n; i++) {

    cin >> a;

    b = 0;
    e = a % 2;

    if (e == 0 && a != 2)
      continue;

    if (a == 2) {
      c++;
    } else {

      for (int j = 1; j <= sqrt(a); j += 2) {

        d = a % j;

        if (d == 0) {
          b++;
        }
        if (b == 2)
          break;
      }

      if (b == 1) {
        c++;
      }
    }
  }

  cout << c << endl;

  return 0;
}


#include <stdio.h>
#define N 100000000
int a[N + 1]; // 1 mean prime 0 not
// prime number: 2,3,5,7
int isprime(int a[], int target, int n) {
  if (a[target] == 1)
    return 1;
  if (a[target] == 0)
    return 0;
  if (target % 2 == 0) {
    a[target] = 0;
    return 0;
  }
  for (int i = 3; i * i <= target; i++) {
    if (target % i == 0) {
      a[target] = 0;
      return 0;
    }
  }
  a[target] = 1;
  return 1;
}
void print_array(int a[], int n) {
  int i = 0;
  for (i = 0; i < n - 1; i++)
    printf("%d ", a[i]);
  printf("%d\\n", a[i]);
}
int main() {
  int n = 0;
  scanf("%d", &n);

  a[0] = 0;
  a[1] = 0;
  for (int i = 2; i <= N; i++) {
    a[i] = -1; // not checking
  }

  for (int i = 2; i <= N; i++) {

    if (isprime(a, i, N)) {
      for (int j = 2; j * i <= N; j++) {
        a[j * i] = 0;
      }
    }
  }
  // print_array(a,n);
  int res = 0;
  int index;
  for (int i = 0; i < n; i++) {
    scanf("%d", &index);
    res += a[index];
  }
  printf("%d\\n", res);
  return 0;
}

#include <stdio.h>
#define N 10000
// 1 mean prime 0 not
// prime number: 2,3,5,7
int isprime(int target) {
  if (target % 2 == 0) {
    return 0;
  }
  for (int i = 3; i * i <= target; i++) {
    if (target % i == 0) {
      return 0;
    }
  }

  return 1;
}

int main() {
  int n = 0;
  scanf("%d", &n);

  int res = 0;
  int index;
  for (int i = 0; i < n; i++) {
    scanf("%d", &index);
    if (isprime(index))
      res++;
    if (index == 2)
      res++;
  }
  printf("%d\\n", res);
  return 0;
}


#include <iostream>
#include <vector>

// returns 1 instead of true
// also 0 - false
inline int isPrime(const int &n) {
  if (n == 2) {
    return 1;
  }

  if (!(n & 1)) {
    return 0;
  }

  int half = n / 2;
  for (int div = 3; div <= half; div += 2) {
    if (!(n % div)) {
      return 0;
    }
  }
  return 1;
}

int main() {
  int n;
  std::cin >> n;

  std::vector<int> vec(n);
  for (auto &e : vec) {
    std::cin >> e;
  }

  int numOfPrime = 0;
  for (const auto &e : vec) {
    numOfPrime += isPrime(e);
  }

  std::cout << numOfPrime << '\\n';
}

#include <cmath>
#include <iostream>
#include <vector>

// returns 1 instead of true
// also 0 - false
inline int isPrime(const int &n) {
  if (n == 2) {
    return 1;
  }

  if (!(n & 1)) {
    return 0;
  }

  float root = std::sqrt(n);
  for (int div = 3; div <= root; div += 2) {
    if (!(n % div)) {
      return 0;
    }
  }
  return 1;
}

int main() {
  int n;
  std::cin >> n;

  std::vector<int> vec(n);
  for (auto &e : vec) {
    std::cin >> e;
  }

  int numOfPrime = 0;
  for (const auto &e : vec) {
    numOfPrime += isPrime(e);
  }

  std::cout << numOfPrime << '\\n';
}


#include <iostream>
using namespace std;

int Myprime(int x) {
  for (int i = 2; i <= x / 2; i++)
    if (!(x % i))
      return 0;
  return 1;
}

int main() {
  int n, count = 0, x;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> x;
    count += Myprime(x);
  }
  cout << count << "\\n";
  return 0;
}

#include <iostream>
#include <math.h>
using namespace std;

int Myprime(int x) {
  for (int i = 2; i <= sqrt(x); i++)
    if (!(x % i))
      return 0;
  return 1;
}

int main() {
  int n, count = 0, x;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> x;
    count += Myprime(x);
  }
  cout << count << "\\n";
  return 0;
}


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

#define MAX_N 1e6

int main(void) {
  vector<bool> eratos(MAX_N, true);
  eratos[0] = eratos[1] = false;
  for (int i = 2; i * i < MAX_N; i++) {
    if (eratos[i]) {
      for (int j = 2; i * j < MAX_N; j++) {
        eratos[i * j] = false;
      }
    }
  }

  int n, input, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> input;
    if (eratos[input]) {
      ++ans;
    }
  }

  cout << ans << endl;
  return 0;
}

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

#define MAX_N (1e8) + 1

int main(void) {
  vector<bool> eratos(MAX_N, true);
  eratos[0] = eratos[1] = false;
  for (int i = 2; i * i < MAX_N; i++) {
    if (eratos[i]) {
      for (int j = 2; i * j < MAX_N; j++) {
        eratos[i * j] = false;
      }
    }
  }

  int n, input, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> input;
    if (eratos[input]) {
      ++ans;
    }
  }

  cout << ans << endl;
  return 0;
}


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

int gcd(int a, int b) {
  int r;
  while (b > 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}

int main() {
  int n, cnt = 0;
  cin >> n;
  for (int i; i < n; i++) {
    bool judge = true;
    int num;
    cin >> num;
    for (int j = 2; j < num; j++) {
      if (num % j == 0)
        judge = false;
    }
    if (judge)
      cnt += 1;
  }
  cout << cnt << endl;
}

#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

using namespace std;

int gcd(int a, int b) {
  int r;
  while (b > 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}

bool isprime(int x) {
  if (x == 2)
    return true;
  if (x < 2 || x % 2 == 0)
    return false;

  int i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0)
      return false;
    i += 2;
  }
  return true;
}

int main() {
  int n, cnt = 0;
  cin >> n;
  for (int i; i < n; i++) {
    bool judge;
    int num;
    cin >> num;
    judge = isprime(num);
    if (judge)
      cnt += 1;
  }
  cout << cnt << endl;
}


#include <stdio.h>
int main() {
  int i, j, n, x = 0;
  int sosu[10000];
  int count = 0;

  scanf("%d", &n);

  for (i = 0; i < n; i++) {
    scanf("%d", &sosu[i]);
    if (sosu[i] != 2 && (sosu[i] % 2) == 0) {
    } else {
      sosu[x] = sosu[i];
      x++;
    }
  }

  // printf("%d\\n",x);

  for (i = 0; i < x; i++) {
    if (sosu[i] == 1)
      continue;
    int f = 0;
    for (j = 2; j < sosu[i]; j++) {
      if ((sosu[i] % j) == 0) {
        f = 1;
        break;
      }
    }
    if (f == 0)
      count++;
  }

  printf("%d\\n", count);

  return 0;
}

#include <math.h>
#include <stdio.h>

int main() {
  int n, x, count = 0;
  int i, j;

  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (x == 2)
      count++;
    else if (x % 2) {
      for (j = 3; j < sqrt((double)x); j += 2) {
        if (x % j == 0)
          break;
      }
      if (j > sqrt((double)x))
        count++;
    }
  }
  printf("%d\\n", count);

  return 0;
}


#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

const int MAX_NUM = 100000000;
vector<bool> ps(MAX_NUM + 1, true);

int main() {
  ps[0] = ps[1] = false;
  for (int i = 2; i <= MAX_NUM; i++) {
    if (!ps[i]) {
      continue;
    }
    for (int j = i + i; j <= MAX_NUM; j += i) {
      ps[j] = false;
    }
  }

  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    if (ps[k]) {
      ans++;
    }
  }
  cout << ans << endl;
}

#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

const int MAX_NUM = 100000000;
vector<bool> ps(MAX_NUM + 1, true);

int main() {
  ps[0] = ps[1] = false;
  for (int i = 4; i <= MAX_NUM; i += 2) {
    ps[i] = false;
  }
  for (int i = 3; i <= MAX_NUM; i += 2) {
    if (!ps[i]) {
      continue;
    }
    for (int j = i + i; j <= MAX_NUM; j += i) {
      ps[j] = false;
    }
  }

  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int k;
    cin >> k;
    if (ps[k]) {
      ans++;
    }
  }
  cout << ans << endl;
}


#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define INF 1000000001
#define EPS 1.0e-6

using namespace std;

typedef long long ll;

int main() {
  vector<int> prime_number;

  int n;
  cin >> n;
  int a[10500];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n, greater<int>());

  prime_number.push_back(2);
  for (int i = 3; i <= a[0]; i++) {
    int ope = 0;
    for (int j = 0; j < prime_number.size(); j++) {
      if (prime_number[j] * prime_number[j] > i)
        break;

      if (i % prime_number[j] == 0) {
        ope = 1;
        break;
      }
    }
    if (ope == 0)
      prime_number.push_back(i);
  }

  int ans = 0;
  int i = 0, j = 0;

  sort(a, a + n);

  while (i < n && j < prime_number.size()) {
    if (a[i] == prime_number[j]) {
      ans++;
      i++;
      j++;
    } else if (a[i] < prime_number[j])
      i++;
    else if (a[i] > prime_number[j])
      j++;
  }
  cout << ans << endl;

  return 0;
}

#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define INF 1000000001
#define EPS 1.0e-6

using namespace std;

typedef long long ll;

int main() {
  vector<int> prime_number;

  int n;
  cin >> n;
  int a[10500];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int ope = 0;
    for (int j = 2; j * j <= a[i]; j++) {
      if (a[i] % j == 0) {
        ope = 1;
        break;
      }
    }
    if (ope == 0)
      ans++;
  }
  cout << ans << endl;

  return 0;
}


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

bool isPrime(const int);

int main(int argc, char *argv[]) {
  int n, tmp, cnt = 0;
  cin >> n;
  while (n-- > 0) {
    cin >> tmp;
    if (isPrime(tmp)) {
      cnt++;
    }
  }
  cout << cnt << endl;

  return 0;
}

bool isPrime(const int x) {
  if (x < 2) {
    return false;
  }
  for (int i = 2; i < x - 1; i++) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}

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

bool isPrime(const int);

int main(int argc, char *argv[]) {
  int n, tmp, cnt = 0;
  cin >> n;
  while (n-- > 0) {
    cin >> tmp;
    if (isPrime(tmp)) {
      cnt++;
    }
  }
  cout << cnt << endl;

  return 0;
}

bool isPrime(const int x) {
  if (x < 2) {
    return false;
  }
  if (x == 2) {
    return true;
  }
  if (x % 2 == 0) {
    return false;
  }
  int i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0) {
      return false;
    }
    i += 2;
  }
  return true;
}


#include <iostream>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define MAX 100000000

bool NUM[MAX + 1] = {};

int main() {
  REP(i, MAX + 1) NUM[i] = true;
  NUM[0] = false;
  NUM[1] = false;
  for (int i = 2; i * i <= MAX + 1; i++) {
    if (NUM[i] == false)
      continue;
    else {
      for (int j = i * 2; j < MAX + 1; j += i) {
        NUM[j] = false;
      }
    }
  }
  int n, ans = 0;
  cin >> n;
  REP(i, n) {
    int temp;
    cin >> temp;
    if (NUM[temp] == true)
      ans++;
  }
  cout << ans << endl;
  return 0;
}

#include <iostream>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)

bool IsPrime(int N) {
  if (N == 2)
    return true;
  else if (N % 2 == 0)
    return false;
  for (int i = 3; i * i <= N; i += 2) {
    if (N % i == 0)
      return false;
  }
  return true;
}

int main() {
  int n, ans = 0;
  cin >> n;
  REP(i, n) {
    int temp;
    cin >> temp;
    if (IsPrime(temp))
      ans++;
  }
  cout << ans << endl;
  return 0;
}


#include <stdio.h>

int main() {
  int i, j;
  int sum;
  int n;
  int f = 0;
  int count = 0;
  /*数字の合計を入力*/
  scanf("%d", &sum);

  for (i = 0; i < sum; i++) {

    f = 0;
    /*数字を入力*/
    scanf("%d", &n);
    /*素数判定を行う*/
    for (j = 2; j < n; j++) {

      if (n % j == 0) {
        f = 1;
        break;
      }
    }
    /*素数ならカウント*/
    if (f == 0)
      count++;
  }

  /*個数を表示*/
  printf("%d\\n", count);
  return 0;
}

#include <math.h>
#include <stdio.h>
int isPrime(int);
int main() {
  int i;
  int sum;
  int x;
  int count = 0;
  /*数字の合計を入力*/
  scanf("%d", &sum);

  for (i = 0; i < sum; i++) {
    scanf("%d", &x);

    count += isPrime(x);
  }
  printf("%d\\n", count);
  return 0;
}

int isPrime(int x) {
  int i;
  if (x == 2)
    return 1;

  if (x < 2 || x % 2 == 0)
    return 0;

  i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0)
      return 0;
    i = i + 2;
  }

  return 1;
}


/*
 * ITP1_6_B.cpp
 *
 *  Created on: Apr 20, 2018
 *      Author: 13743
 */

#include <iostream>

using namespace std;

bool isPrime(int n) {
  for (int i = 2; i < n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}

int main() {
  int N;
  int cnt = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int n;
    cin >> n;
    if (isPrime(n)) {
      cnt++;
    }
  }
  cout << cnt << endl;
}

/*
 * ITP1_6_B.cpp
 *
 *  Created on: Apr 20, 2018
 *      Author: 13743
 */

#include <cmath>
#include <iostream>

using namespace std;

bool isPrime(int n) {
  int r = sqrt(n);
  for (int i = 2; i <= r; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}

int main() {
  int N;
  int cnt = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int n;
    cin >> n;
    if (isPrime(n)) {
      cnt++;
    }
  }
  cout << cnt << endl;
}


#include <cmath>
#include <iostream>
#include <vector>
#define MAX 10000
using namespace std;
bool isntprime[10001];

int main() {
  isntprime[0] = isntprime[1] = true;
  for (int i = 2; i <= MAX; i++)
    if (!isntprime[i])
      for (int j = i * i; j <= MAX; j += i)
        isntprime[j] = true;

  int n, cnt, in;
  cin >> n;
  cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> in;
    if (!isntprime[in])
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}

#include <bits/stdc++.h>

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)

using namespace std;

typedef long long ll;

long long extgcd(long long a, long long b, long long &x, long long &y) {
  long long d = a;
  if (b != 0) {
    d = extgcd(b, a % b, y, x);
    y -= (a / b) * x;
  } else
    x = 1, y = 0;
  return d;
}

long long mod_inv(long long a, long long m) {
  long long x, y;
  extgcd(a, m, x, y);
  return (m + x % m) % m;
}

ll modmultiply(ll a, ll b, ll c) {
  ll x = 0, y = a % c;
  while (b > 0) {
    if (b % 2 == 1)
      x = (x + y) % c;
    y = (y * 2) % c;
    b /= 2;
  }
  return x % c;
}

ll modpow(ll x, ll y, ll mod) {
  ll ret = 1; // ret = x^y%mod;
  while (y) {
    if (y & 1)
      // ret = (ret*x)%mod;
      ret = modmultiply(ret, x, mod);
    // x = (x*x)%mod;
    x = modmultiply(x, x, mod);
    y >>= 1;
  }
  return ret;
}

#define MR_MAX 40
bool MillerRabin(long long v) {
  if (v == 2)
    return true;
  if (v < 2 || !(v & 1LL))
    return false;
  srand((unsigned int)time(NULL));
  long long d = v - 1;
  while ((d & 1LL) == 0)
    d >>= 1LL;
  for (int i = 0; i < MR_MAX; ++i) {
    long long a = rand() % (v - 2) + 1LL;
    long long t = d;
    long long y = modpow(a, t, v);
    while (t != v - 1LL && y != 1LL && y != v - 1LL) {
      y = (y * y) % v;
      t <<= 1LL;
    }
    if (y != v - 1LL && (t & 1LL) == 0)
      return false;
  }
  return true;
}

int main() {
  int n, v, cnt = 0;
  cin >> n;
  rep(i, n) {
    cin >> v;
    cnt += MillerRabin(v);
  }
  cout << cnt << endl;
  /*
  string pi;
  cin >> pi;
  rep(i,(int)pi.size()-10) {
    assert(i+10-1<(int)pi.size());
    string tmp = pi.substr(i,10);
    long long prim = atoll(tmp.c_str());
    if( MillerRabin(prim) ) {
      cout << "Found!!! : " << prim << endl;
    }
  }
  puts("Not Found...");
  */
  return 0;
}


#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
bool prime[10009];
inline void prime_sifter(int);
int main() {
  memset(prime, true, sizeof(prime));
  int n, count = 0, x;
  cin >> n;
  prime_sifter(100000009);
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    if (x <= 1)
      continue;
    if (prime[x])
      ++count;
  }
  cout << count << endl;
  return 0;
}
inline void prime_sifter(int n) {
  for (int i = 2; i <= n; ++i) {
    if (prime[i]) {
      for (int j = i + i; j <= n; j += i) {
        prime[j] = false;
      }
    }
  }
}

#include <cmath>
#include <iostream>
using namespace std;
inline bool is_prime(int n) {
  if (n <= 1)
    return false;
  int m = (int)(floor(sqrt(n) + 0.5));
  for (int i = 2; i <= m; ++i) {
    if (n % i == 0)
      return false;
  }
  return true;
}
int main() {
  int x, count = 0, m;
  cin >> x;
  for (int i = 1; i <= x; ++i) {
    cin >> m;
    if (m <= 1)
      ;
    else if (is_prime(m))
      ++count;
  }
  cout << count << endl;
  return 0;
}


#include <iostream>
using namespace std;

int getPrimeNumbers(int max, int prime[]) {
  prime[0] = 2;
  int counter = 0;
  bool isPrime;
  for (int i = 3; i < max + 1 / 2; i += 2) {
    isPrime = true;
    for (int j = 0; j <= counter; j++) {
      if (i % prime[j] == 0)
        isPrime = false;
    }
    if (isPrime) {
      prime[++counter] = i;
    }
  }
  return counter;
}

int main() {

  int max, num = 0;
  int element[10000];
  int prime[1000000];
  int numOfPrime = 1;

  cin >> num;

  for (int i = 0; i < num; i++) {
    cin >> element[i];
    if (max <= element[i]) {
      max = element[i];
    }
  }

  numOfPrime = getPrimeNumbers(max, prime);

  int primeCounter = 0;
  for (int i = 0; i < num; i++) {
    for (int j = 0; j < numOfPrime; j++) {
      if (prime[j] == element[i]) {
        primeCounter++;
        break;
      }
      if (element[i] % prime[j] == 0) {
        break;
      } else if (element[i] < prime[j] * 2) {
        primeCounter++;
        break;
      }
    }
  }

  cout << primeCounter << endl;

  return 0;
}

#include <iostream>
using namespace std;

int getPrimeNumbers(int max, int prime[]) {
  prime[0] = 2;
  int counter = 0;
  bool isPrime;
  for (int i = 3; prime[counter] * prime[counter] < max; i += 2) {
    isPrime = true;
    for (int j = 0; j <= counter; j++) {
      if (i % prime[j] == 0)
        isPrime = false;
    }
    if (isPrime) {
      prime[++counter] = i;
    }
  }
  return counter;
}

int main() {

  int max, num = 0;
  int element[10000];
  int prime[10000];
  int numOfPrime = 1;

  cin >> num;

  for (int i = 0; i < num; i++) {
    cin >> element[i];
    if (max <= element[i]) {
      max = element[i];
    }
  }

  numOfPrime = getPrimeNumbers(max, prime);

  int primeCounter = 0;
  for (int i = 0; i < num; i++) {
    for (int j = 0; j <= numOfPrime; j++) {
      if (prime[j] == element[i]) {
        primeCounter++;
        break;
      }
      if (element[i] % prime[j] == 0) {
        break;
      }
      if (element[i] < prime[j] * prime[j]) {
        primeCounter++;
        break;
      }
    }
  }

  cout << primeCounter << endl;

  return 0;
}


#include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

int main() {
  // ifstream fin("ALDS1_1_C_in1.txt");

  int n;
  cin >> n;
  cin.ignore();

  vector<int> v;

  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    v.push_back(t);
  }

  int m = *max_element(v.begin(), v.end()) + 1;

  bool *bp;
  bp = (bool *)malloc(sizeof(bool) * m);

  memset(bp, true, sizeof(bool) * m);
  bp[0] = false;
  bp[1] = false;

  for (int i = 2; i * i < m; i++) {
    if (*(bp + sizeof(bool) * i) == true) {
      for (int j = i * i; j < m; j += i) {
        *(bp + sizeof(bool) * j) = false;
      }
    }
  }

  int count = 0;
  for (int i = 0; i < v.size(); i++) {
    if (*(bp + v[i]) == true)
      count++;
  }
  cout << count << endl;

  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

int main() {
  // ifstream fin("ALDS1_1_C_in1.txt");

  int n;
  cin >> n;
  cin.ignore();

  vector<int> v;

  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    v.push_back(t);
  }

  int count = 0;
  for (int i = 0; i < v.size(); i++) {
    bool isPrime = true;
    for (int j = 2; j <= sqrt(v[i]); j++) {
      if (v[i] % j == 0) {
        isPrime = false;
        break;
      }
    }
    if (isPrime == true)
      count++;
  }
  cout << count << endl;

  return 0;
}


#include <iostream>
using namespace std;

bool prime[100000001][2] = {false};

int main() {
  int n;
  cin >> n;

  for (int i = 2; i <= 10000; i++) {
    if (prime[i][0] == false) {
      prime[i][1] = true;
      for (int j = i; j <= 100000000; j += i) {
        prime[j][0] = true;
      }
    }
  }

  int temp, count = 0;
  for (int i = 0; i < n; i++) {
    cin >> temp;
    if (prime[temp][1] == true) {
      count++;
    }
  }
  cout << count << endl;
}

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

int main() {
  int n, num, count = 0;

  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    if (num == 2) {
      count++;
      continue;
    }

    for (int j = 2; j <= sqrt(num); j++)
      if (num % j == 0) {
        count--;
        break;
      }

    count++;
  }
  cout << count << endl;
}


#include <iostream>
using namespace std;

bool IsPrime(int n) {
  int count = 0;
  for (int i = 1; i <= n; i++) {
    if (n % i == 0) {
      count++;
    }
    if (count > 2) {
      return false;
    }
  }
  return (count == 2);
}

int main(void) {
  int count = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    if (IsPrime(p)) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}

#include <iostream>
using namespace std;

bool IsPrime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}

int main(void) {
  int count = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    if (IsPrime(p)) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}


#include <iostream>
int main(void) {
  std::ios::sync_with_stdio(false);
  int n, COUNT = 0;
  std::cin >> n;
  int x;
  for (int i = 0; i < n; ++i) {
    std::cin >> x;
    if (x == 2) {
      ++COUNT;
    } else if (x % 2 != 0) {
      bool FLUG = false;
      int Max = static_cast<int>(x / 2) + 1;
      for (int i = 3; i < Max; i += 2) {
        if (x % i == 0) {
          FLUG = true;
          break;
        }
      }
      if (FLUG == false) {
        ++COUNT;
      }
    }
  }
  std::cout << COUNT << std::endl;
  // system("pause");
  return 0;
}

#include <iostream>
int main(void) {
  std::ios::sync_with_stdio(false);
  int n, COUNT = 0;
  std::cin >> n;
  int x;
  for (int i = 0; i < n; ++i) {
    std::cin >> x;
    if (x == 2) {
      ++COUNT;
    } else if (x % 2 != 0) {
      bool FLUG = false;
      for (int i = 3; i * i <= x; i += 2) {
        if (x % i == 0) {
          FLUG = true;
          break;
        }
      }
      if (FLUG == false) {
        ++COUNT;
      }
    }
  }
  std::cout << COUNT << std::endl;
  // system("pause");
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 100000000
bool a[100000000];
int main() {
  a[0] = a[1] = 1;
  for (int i = 2; i * i <= N; i++)
    if (a[i] == 0)
      for (int j = 2; j * i < N; j++)
        a[i * j] = 1;

  int n, count = 0, m[10000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m[i];
    if (a[m[i]] == 0)
      count++;
  }
  cout << count << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0, m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> m;
    for (int j = 2; j * j <= m; j++)
      if (m % j == 0) {
        count++;
        break;
      }
  }
  cout << n - count << endl;
  return 0;
}


#include <iostream>
using namespace std;
bool is_prime[100000000];

int main() {
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i < 100000000; i++) {
    is_prime[i] = true;
  }

  for (int i = 2; i * i < 100000000; i++) {
    if (is_prime[i]) {
      for (int j = i * i; j < 100000000; j += i) {
        is_prime[j] = false;
      }
    }
  }

  int n, count, tmp;
  cin >> n;

  count = 0;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (is_prime[tmp]) {
      count++;
    }
  }

  cout << count << endl;

  return 0;
}

#include <iostream>
using namespace std;
#include <math.h>

bool IsPrime(int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false; // 偶数はあらかじめ除く

  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      // 素数ではない
      return false;
    }
  }

  // 素数である
  return true;
}

int main() {

  int n, count, tmp;
  cin >> n;

  count = 0;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (IsPrime(tmp)) {
      count++;
    }
  }

  cout << count << endl;

  return 0;
}


#include <iostream>
using namespace std;

bool is_prime[50000000];
int main() {

  for (int i = 0; i < 50000000; i++) {
    is_prime[i] = true;
  }

  is_prime[0] = false;
  for (int i = 1; i < 50000000; i++) {
    if (is_prime[i]) {
      for (int j = i * 3 + 1; j < 50000000; j += 2 * i + 1) {
        is_prime[j] = false;
      }
    }
  }

  int n, tag;
  cin >> n;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> tag;
    if (tag % 2 == 0) {
      if (tag == 2) {
        cnt++;
      }
    } else {
      if (is_prime[tag / 2]) {
        cnt++;
      }
    }
  }

  cout << cnt << endl;
  int xxx;
  cin >> xxx;
  return 0;
}

#include <iostream>
using namespace std;

bool is_prime[50000000];
int main() {

  for (int i = 0; i < 50000000; i++) {
    is_prime[i] = true;
  }

  is_prime[0] = false;
  for (int i = 1; i * i + i < 25000000; i++) {
    if (is_prime[i]) {
      for (int j = i * 3 + 1; j < 50000000; j += 2 * i + 1) {
        is_prime[j] = false;
      }
    }
  }

  int n, tag;
  cin >> n;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> tag;
    if (tag % 2 == 0) {
      if (tag == 2) {
        cnt++;
      }
    } else {
      if (is_prime[tag / 2]) {
        cnt++;
      }
    }
  }

  cout << cnt << endl;
  int xxx;
  cin >> xxx;
  return 0;
}


#include <iostream>
using namespace std;
bool IsPrime(int x) {
  int i, j = 2;

  for (i = 2; i <= x; i++) {
    if ((x % i) == 0)
      break;
    j++;
  }

  if (j == x)
    return true;
  else
    return false;
}

int main(void) {
  int p, n, COUNT = 0;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> p;
    if (IsPrime(p))
      COUNT++;
  }

  cout << COUNT << endl;

  return 0;
}

#include <iostream>
using namespace std;
bool IsPrime(int x) {
  int i;

  for (i = 2; i * i <= x; i++) {
    if ((x % i) == 0)
      return false;
  }

  return true;
}

int main(void) {
  int p, n, COUNT = 0;

  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> p;
    if (IsPrime(p))
      COUNT++;
  }

  cout << COUNT << endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
struct cww {
  cww() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  }
} star;
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i));
#define rep(i, a, n) for (int i = (a), i##_len = (n); i < i##_len; ++i)
#define rrep(i, a, n) for (int i = (a); i > n; --i)
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
int main() {
  int n;
  cin >> n;
  vi v;
  v.reserve(n);
  int cnt = 0, tmp;
  rep(i, 0, n) {
    cin >> tmp;
    if (tmp == 2 || tmp == 3 || tmp == 5 || tmp == 7)
      ++cnt;
    else if (tmp % 2 != 0 && tmp % 3 != 0 && tmp % 5 != 0 && tmp % 7 != 0)
      v.eb(tmp);
  }
  if (len(v) == 0) {
    P(cnt);
    return 0;
  }
  sort(all(v));
  vi so{2};
  so.reserve(10000);
  int max_v = *max_element(all(v));
  for (int i = 3; i <= max_v; i += 2) {
    bool flg = false;
    rep(j, 0, len(so)) {
      if (i % so[j] == 0) {
        flg = true;
        break;
      }
    }
    if (flg)
      continue;
    so.eb(i);
    cnt += count(all(v), i);
  }
  P(cnt);
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
struct cww {
  cww() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  }
} star;
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i));
#define rep(i, a, n) for (int i = (a), i##_len = (n); i < i##_len; ++i)
#define rrep(i, a, n) for (int i = (a); i > n; --i)
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
inline bool isprime(int x) {
  for (int i = 2; i * i <= x; ++i)
    if (x % i == 0)
      return false;
  return true;
}
int main() {
  int n;
  cin >> n;
  int tmp, cnt = 0;
  rep(i, 0, n) {
    cin >> tmp;
    if (isprime(tmp))
      ++cnt;
  }
  P(cnt);
  return 0;
}


#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define repi(i, n, a) for (int i = a; i < n; ++i)
#define num 100000010

int main(void) {
  int n, i, j, ans = 0, a;
  bool *f;
  f = (bool *)malloc(sizeof(bool) * num);
  rep(i, num) f[i] = true;
  repi(i, 10002, 2) if (f[i]) for (j = 2; i * j <= num; ++j) f[i * j] = false;
  scanf("%d", &n);
  rep(i, n) {
    scanf("%d", &a);
    if (f[a])
      ++ans;
  }
  printf("%d\\n", ans);
  free(f);
  return 0;
}

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define repi(i, n, a) for (int i = a; i < n; ++i)
#define num 50000010

int main(void) {
  int n, i, j, ans = 0, a;
  bool *f;
  f = (bool *)malloc(sizeof(bool) * num);
  rep(i, num) f[i] = true;
  repi(i, 8002, 1) if (f[i]) for (j = 3 * i + 1; j <= num; j += 2 * i + 1)
      f[j] = false;
  scanf("%d", &n);
  rep(i, n) {
    scanf("%d", &a);
    if (a == 2)
      ++ans;
    if (a % 2 && f[(a - 1) / 2])
      ++ans;
  }
  printf("%d\\n", ans);
  free(f);
  return 0;
}


#include <algorithm>
#include <stdio.h>
#include <vector>

int gcd(int x, int y) {

  if (y == 0)
    return x;
  if (x >= y)
    return gcd(y, x % y);
  else
    return gcd(x, y % x);
}

bool isprime(int a) {
  if (a == 1)
    return false;

  for (int i = 2; i < a; i++) {
    if (a % i == 0)
      return false;
  }

  return true;
}

int main() {
  int n;
  std::vector<int> d;

  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int b;
    scanf("%d", &b);
    d.push_back(b);
  }

  printf("%d\\n", std::count_if(d.begin(), d.end(), isprime));

  return 0;
}

#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <vector>

bool isprime(int a) {
  if (a == 1)
    return false;

  for (int i = 2; i <= sqrt(a); i++) {
    if (a % i == 0)
      return false;
  }

  return true;
}

int main() {
  int n;
  std::vector<int> d;

  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int b;
    scanf("%d", &b);
    d.push_back(b);
  }

  printf("%d\\n", std::count_if(d.begin(), d.end(), isprime));

  return 0;
}


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

int a[10001];
bool prime_table[10000001];
int max_a = 0;

void make_prime_table() {
  for (int i = 0; i <= max_a; i++)
    prime_table[i] = true;
  prime_table[0] = prime_table[1] = false;
  for (int i = 2; i <= max_a; i++) {
    if (prime_table[i]) {
      for (int j = 2 * i; j <= max_a; j += i)
        prime_table[j] = false;
    }
  }
  return;
}

void solve(int n) {
  make_prime_table();
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (prime_table[a[i]])
      count++;
  }
  cout << count << endl;
  return;
}

int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    max_a = max(max_a, a[i]);
  }
  solve(n);
  return 0;
}

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

bool prime_table[100000001];

bool is_prime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0)
      return false;
  }
  return n != 1;
}

int main() {
  int n, tmp;
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (is_prime(tmp))
      count++;
  }
  cout << count << endl;
  return 0;
}


#include <stdio.h>
int sosuu(int);
int main() {
  int a, b, c, count1 = 0;
  scanf("%d", &a);
  for (int i = 0; i < a; i++) {
    scanf("%d", &b);
    c = sosuu(b);
    if (c == 1)
      count1++;
  }
  printf("%d\\n", count1);
  return 0;
}
int sosuu(int x) {
  int count = 0, d;
  if (x > 2 && x % 2 == 0)
    return d;
  for (int i = 1; i <= x; i++) {
    if (x % i == 0)
      count++;
  }
  if (count == 2)
    d = 1;
  else
    d = 0;
  return d;
}

#include <math.h>
#include <stdio.h>
int hantei(int a);
int main() {
  int a, B[100000], z, count = 0, i;
  scanf("%d", &a);
  for (i = 0; i < a; i++) {
    scanf("%d", &B[i]);
    z = hantei(B[i]);
    if (z == 0)
      count++;
  }
  printf("%d\\n", count);
}
int hantei(int a) {
  int i = 3;
  if (a == 2)
    return 0;
  if (a < 2 || a % 2 == 0)
    return 1;
  while (i <= pow(a, 0.5)) {
    if (a % i == 0)
      return 1;
    i += 2;
  }
  return 0;
}


#include <cassert>
#include <iostream>
#include <math.h>
using namespace std;

bool isPrime(int x) {
  if (x < 2)
    return false;
  else if (x == 2)
    return true;
  if (x % 2 == 0)
    return false;
  int limit = (int)sqrt((double)x) + 1;
  for (int i = 3; i < x / 2; i += 2) {
    if (x % i == 0)
      return false;
  }
  return true;
}

int main() {
  int n, x;
  int cnt = 0;
  cin >> n;
  assert(1 <= n && n <= 10000);
  for (int i = 0; i < n; i++) {
    cin >> x;
    assert(2 <= x && x <= 1000000000);
    if (isPrime(x))
      cnt++;
  }
  cout << cnt << endl;
}

#include <cassert>
#include <iostream>
#include <math.h>
using namespace std;

bool isPrime(int x) {
  if (x < 2)
    return false;
  else if (x == 2)
    return true;
  if (x % 2 == 0)
    return false;
  int limit = (int)sqrt((double)x) + 1;
  for (int i = 3; i <= limit; i += 2) {
    if (x % i == 0)
      return false;
  }
  return true;
}

int main() {
  int n, x;
  int cnt = 0;
  cin >> n;
  assert(1 <= n && n <= 10000);
  for (int i = 0; i < n; i++) {
    cin >> x;
    assert(2 <= x && x <= 1000000000);
    if (isPrime(x))
      cnt++;
  }
  cout << cnt << endl;
}


//
// ALDS1_1 - C Prime Numbers
// A prime number is a natural number which has exactly two distinct natural
// number divisors: 1 and itself. For example, the first four prime numbers are:
// 2, 3, 5 and 7.
//
// Write a program which reads a list of N integers and prints the number of
// prime numbers in the list.
//
#include <iostream>
using namespace std;

void read(int &size, int **ppArray);
void checkPrimeNumbers(size_t size, const int *pArray, int &count);
void write(const int count);

int main() {
  int size = 0, ret = 0;
  int *pArray = NULL;

  read(size, &pArray);
  checkPrimeNumbers(size, pArray, ret);
  write(ret);

  delete pArray;
}

void read(int &size, int **ppArray) {
  if (NULL == ppArray || NULL != *ppArray)
    return;

  cin >> size;
  if (10000 < size)
    return;

  *ppArray = new int[size];
  for (int i = 0; i < size; i++) {
    cin >> *(*ppArray + i);
  }
}

void checkPrimeNumbers(size_t size, const int *pArray, int &count) {
  if (NULL == pArray)
    return;

  for (int i = 0; i < size; i++) {
    int value = *(pArray + i);
    if (2 == value) {
      count++;
      continue;
    }
    if (0 == value % 2)
      continue;
    for (int j = 3; j <= value; j += 2) {
      if (value == j) {
        count++;
        break;
      }
      if (0 == value % j)
        break;
    }
  }
}

void write(const int count) { cout << count << endl; }

//
// ALDS1_1 - C Prime Numbers
// A prime number is a natural number which has exactly two distinct natural
// number divisors: 1 and itself. For example, the first four prime numbers are:
// 2, 3, 5 and 7.
//
// Write a program which reads a list of N integers and prints the number of
// prime numbers in the list.
//
#include <cmath>
#include <iostream>
using namespace std;

void read(int &size, int **ppArray);
void checkPrimeNumbers(size_t size, const int *pArray, int &count);
void write(const int count);

int main() {
  int size = 0, ret = 0;
  int *pArray = NULL;

  read(size, &pArray);
  checkPrimeNumbers(size, pArray, ret);
  write(ret);

  delete pArray;
}

void read(int &size, int **ppArray) {
  if (NULL == ppArray || NULL != *ppArray)
    return;

  cin >> size;
  if (10000 < size)
    return;

  *ppArray = new int[size];
  for (int i = 0; i < size; i++) {
    cin >> *(*ppArray + i);
  }
}

void checkPrimeNumbers(size_t size, const int *pArray, int &count) {
  if (NULL == pArray)
    return;

  for (int i = 0; i < size; i++) {
    bool flag = true;
    int value = *(pArray + i);
    if (2 > value)
      continue;
    if (2 == value) {
      count++;
      continue;
    }
    if (0 == value % 2)
      continue;
    for (int j = 3; j <= (int)sqrt(value); j += 2) {
      if (0 == value % j) {
        flag = false;
        break;
      }
    }
    if (true == flag)
      count++;
  }
}

void write(const int count) { cout << count << endl; }


#include <iostream>
#include <vector>

class PrimeNumbers {
private:
  std::vector<int> dataSet;
  bool isPrimeNumber(int x);

public:
  PrimeNumbers(std::vector<int> vec);
  int getPrimeCount();
};

PrimeNumbers::PrimeNumbers(std::vector<int> vec) { this->dataSet = vec; }

bool PrimeNumbers::isPrimeNumber(int x) {
  if (x < 2)
    return false;
  if (x == 2)
    return true;
  if (x % 2 == 0)
    return false;
  for (int i = 3; i < (x / 2); i++) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}

int PrimeNumbers::getPrimeCount() {
  int returnCount = 0;
  for (int i : dataSet) {
    if (isPrimeNumber(i)) {
      returnCount++;
    }
  }
  return returnCount;
}

int main() {

  int loop;

  std::cin >> loop;

  int input;
  std::vector<int> vec;

  for (int i = 0; i < loop; i++) {
    std::cin >> input;
    vec.push_back(input);
  }

  PrimeNumbers pn = PrimeNumbers(vec);
  std::cout << pn.getPrimeCount() << std::endl;

  return 0;
}

#include <cmath>
#include <iostream>
#include <vector>

class PrimeNumbers {
private:
  std::vector<int> dataSet;
  bool isPrimeNumber(int x);

public:
  PrimeNumbers(std::vector<int> vec);
  int getPrimeCount();
};

PrimeNumbers::PrimeNumbers(std::vector<int> vec) { this->dataSet = vec; }

bool PrimeNumbers::isPrimeNumber(int x) {
  if (x < 2)
    return false;
  if (x == 2)
    return true;
  if (x % 2 == 0)
    return false;
  for (int i = 3; i <= sqrt(x); i += 2) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}

int PrimeNumbers::getPrimeCount() {
  int returnCount = 0;
  for (int i : dataSet) {
    if (isPrimeNumber(i)) {
      returnCount++;
    }
  }
  return returnCount;
}

int main() {

  int loop;

  std::cin >> loop;

  int input;
  std::vector<int> vec;

  for (int i = 0; i < loop; i++) {
    std::cin >> input;
    vec.push_back(input);
  }

  PrimeNumbers pn = PrimeNumbers(vec);
  std::cout << pn.getPrimeCount() << std::endl;

  return 0;
}


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

long long inf = 10e8;
vector<int> v(inf + 1);
// vector<int> prime;

void erast() {
  for (int i = 0; i <= inf; i++) {
    v[i] = 1;
  }
  for (int i = 2; i * i <= inf; i++) {
    if (v[i]) {
      for (int j = 0; i * (j + 2) <= inf; j++) {
        v[i * (j + 2)] = 0;
      }
    }
  }
  /*for(int i=2;i<10000;i++){
          if(v[i]){
                  prime.push_back(i);
          }
  }*/
}

int n, x;

int main() {
  erast();
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (v[x])
      count++;
  }
  cout << count << endl;
}

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

int n, x;

bool isprime(long long x) {
  if (x == 2)
    return true;
  if (x < 2 || x % 2 == 0)
    return false;
  int i = 3;
  while (i * i <= x) {
    if (x % i == 0)
      return false;
    i += 2;
  }
  return true;
}

int main() {
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (isprime(x))
      count++;
  }
  cout << count << endl;
}


#include <iostream>
using namespace std;

int main() {
  int N, num, count_d, count_p = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    count_d = 0;
    cin >> num;
    for (int j = 1; j <= (num / 2); j++) {
      if (num % j == 0) {
        ++count_d;
      }
    }
    if (count_d == 1) {
      ++count_p;
    }
  }
  cout << count_p << endl;

  return 0;
}

#include <iostream>
using namespace std;

bool isPrime(int x) {
  if (x == 2) {
    return true;
  }
  if ((x % 2) == 0) {
    return false;
  }
  for (int i = 3; i * i <= x; i += 2) {
    if ((x % i) == 0) {
      return false;
    }
  }
  return true;
}

int main() {
  int N, num, cnt = 0;
  cin >> N;
  while (N) {
    N--;
    cin >> num;
    cnt += isPrime(num);
  }

  cout << cnt << endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
  bool num[10002] = {false};
  int give[260];
  int maxs = 0, n, co = 0;
  for (int i = 0; (scanf("%d", &give[i]) != EOF); ++i) {
    if (maxs < give[i])
      maxs = give[i];
    n = i;
  }
  num[1] = true;
  for (int i = 2; i <= sqrt(maxs); i++) { // 素数＝0；素数じゃない＝１；
    if (!num[i]) {
      for (int j = 2; j * i <= maxs; j++) {
        num[j * i] = true;
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    if (!num[give[i]])
      co++;
  }
  cout << co << endl;
}

#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for (int i = 0; i < (int)n; ++i)

bool isPrime(int num) {
  if (num == 2)
    return true;
  if (num % 2 == 0)
    return false;

  // +1 重要
  for (int i = 3; i < sqrt(num) + 1; i += 2) {
    if (num % i == 0)
      return false;
  }
  return true;
}

int main() {
  int N;
  int count = 0;
  int num;

  cin >> N;

  REP(i, N) {
    cin >> num;
    if (isPrime(num))
      ++count;
  }

  cout << count << endl;

  return 0;
}


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

int main() {
  int n;
  cin >> n;
  int a, b;
  vector<int> c(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < c[i] / 2; j++) {
      a = c[i] % j;
      if (a == 0) {
        b++;
      }
    }
  }
  cout << b << endl;
  return 0;
}

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

bool isprime(int x) {
  if (x == 2) {
    return true;
  } else if (x % 2 == 0) {
    return false;
  }
  int i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0) {
      return false;
      break;
    }
    i = i + 2;
  }
  return true;
}
int main() {
  int n, ans = 0;
  cin >> n;
  vector<int> c(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  for (int i = 0; i < n; i++) {
    if (isprime(c[i])) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int n;
  int cnt;

  cin >> n;
  cnt = n;
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    for (int j = 2; j < num; j++) {
      if (num % j == 0) {
        cnt--;
        break;
      }
    }
  }

  cout << cnt << endl;

  return 0;
}

#include <iostream>
#include <math.h>
using namespace std;

const int MAX = 10000;

bool prime(int n) {
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0)
      return false;
  }
  return true;
}

int main() {
  int n;
  int cnt = 0;

  cin >> n;
  for (int i = 0; i < n; i++) {
    int buf;
    cin >> buf;
    if (prime(buf))
      cnt++;
  }

  cout << cnt << endl;
  return 0;
}


#include <bits/stdc++.h>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) range(i, 0, b)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

const int N = 10000;

void primeNumber(bool prime[N]) {
  rep(i, N) prime[i] = 1;
  prime[0] = prime[1] = 0;
  rep(i, N) {
    if (prime[i]) {
      for (int j = i + i; j < N; j += i) {
        prime[j] = 0;
      }
    }
  }
}
int main() {
  bool prime[N];
  int sum = 0;
  primeNumber(prime);
  for (int n; cin >> n;) {
    sum += static_cast<int>(prime[n]);
  }
  cout << sum << endl;
}

#include <bits/stdc++.h>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) range(i, 0, b)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

int primeNumber(int n) {
  if (n == 2)
    return 1;
  else if (n < 2)
    return 0;
  else {
    for (int i = 2; i * i <= n; i++) {
      if (n % i == 0)
        return 0;
    }
    return 1;
  }
}
int main() {
  int sum = 0;
  for (int n; cin >> n;) {
    sum += primeNumber(n);
  }
  cout << sum << endl;
}


#include <iostream>
using namespace std;
static const int N = 100;
int a[N];
int i, n, flag;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = 0;
  for (i = 0; i < n; i++) {
    flag = 1;
    for (int k = 2; k * k <= a[i]; k++) {
      if (a[i] % k == 0) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

#include <iostream>
using namespace std;

int x;
int i, n, flag;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  int ans;
  for (i = 0; i < n; i++) {
    cin >> x;
    if (x == 2) {
      ans++;
    } else if (x % 2 != 0) {
      flag = 1;
      for (int j = 3; j * j <= x; j += 2) {
        if (x % j == 0) {
          flag = 0;
          break;
        }
      }
      if (flag == 1) {
        ans++;
      }
    }
  }

  cout << ans << endl;
  return 0;
}


#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v, i) (v).erase(remove(all(v), i), (v).end())
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define each(it, c)                                                            \\
  for (typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define debug(x) cerr << #x << " = " << (x) << endl;
#define LINE cerr << "LINE: " << __LINE__ << endl;
inline int toInt(string s) {
  int v;
  istringstream i(s);
  i >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream o;
  o << x;
  return o.str();
}
template <class T> void pv(T a, T b) {
  for (T it = a; it != b; ++it)
    cerr << *it << " ";
  cerr << endl;
}
const int INF = 1000000000;
const double PI = acos(-1.0), EPS = 1e-10;

const int M = 100000000;

bool isp[M + 1];

int main() {
  memset(isp, -1, sizeof isp);
  isp[0] = isp[1] = false;
  for (int i = 2; i * i <= M; i++)
    if (isp[i])
      for (int j = 2 * i; j <= M; j += i)
        isp[j] = false;
  int N;
  cin >> N;
  int cnt = 0;
  rep(i, N) {
    int p;
    cin >> p;
    if (isp[p])
      cnt++;
  }
  cout << cnt << endl;
}

#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define ERASE(v, i) (v).erase(remove(all(v), i), (v).end())
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define each(it, c)                                                            \\
  for (typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define debug(x) cerr << #x << " = " << (x) << endl;
#define LINE cerr << "LINE: " << __LINE__ << endl;
inline int toInt(string s) {
  int v;
  istringstream i(s);
  i >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream o;
  o << x;
  return o.str();
}
template <class T> void pv(T a, T b) {
  for (T it = a; it != b; ++it)
    cerr << *it << " ";
  cerr << endl;
}
const int INF = 1000000000;
const double PI = acos(-1.0), EPS = 1e-10;

int main() {
  int cnt = 0;
  int N;
  cin >> N;
  rep(i, N) {
    int p;
    cin >> p;
    bool f = true;
    for (int j = 2; j * j <= p; j++)
      if (p % j == 0) {
        f = false;
        break;
      }
    if (f)
      cnt++;
  }
  cout << cnt << endl;
}


#include <iostream>

bool judge_prime(int num) {
  if (num == 2 || num == 3) {
    return true;
  }

  if (num % 2 == 0 || num % 3 == 0) {
    return false;
  }
  for (int i = 2; i <= (num + 1) / 2; i++) {
    if (i % 2 == 0) {
      i++;
    }
    if (i % 3 == 0) {
      i++;
    }
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}

int main() {

  int num;
  std::cin >> num;

  int list[num];
  for (int i = 0; i < num; i++) {
    std::cin >> list[i];
  }

  int result = 0;
  for (int i = 0; i < num; i++) {
    if (judge_prime(list[i])) {
      result++;
    }
  }
  std::cout << result << std::endl;
}

#include <iostream>
#include <math.h>

bool judge_prime(int num) {
  if (num == 2 || num == 3) {
    return true;
  }

  for (int i = 2; i <= sqrt(num); i++) {

    if (num % i == 0) {
      return false;
    }
  }
  return true;
}

int main() {

  int num;
  std::cin >> num;

  int list[num];
  for (int i = 0; i < num; i++) {
    std::cin >> list[i];
  }

  int result = 0;
  for (int i = 0; i < num; i++) {
    if (judge_prime(list[i])) {
      result++;
    }
  }
  std::cout << result << std::endl;
}


#include <iostream>
using namespace std;

bool isPrime(int a) {
  int b = a / 2;
  if (a == 1)
    return false;
  for (int i = b; i >= 1; i--) {
    if (a % i == 0 && i != 1)
      return false;
  }
  return true;
}

int main() {
  int n;
  cin >> n;
  int number[n];
  for (int i = 0; i < n; i++) {
    cin >> number[i];
  }
  int count = 0;
  for (int p = 0; p < n; p++) {
    if (isPrime(number[p]))
      count++;
  }
  cout << count << endl;
  return 0;
}

#include <iostream>
#include <math.h>

using namespace std;

int isPrimeNumbers(int x) {
  if (x == 1) {
    return 0;
  } else if (x == 2) {
    return 1;
  } else if ((x % 2) == 0) {
    return 0;
  } else {
    int y = pow(x, (1.0 / 2.0));
    for (int p = 3; p <= y; p++) {
      if (x % p == 0)
        return 0;
    }
  }
  return 1;
}

int main() {
  int n;
  cin >> n;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (isPrimeNumbers(x[i]) == 1) {
      count++;
      // cout<<isPrimeNumbers(x[i])<<endl<<x[i]<<endl;
    } else {
      continue;
    }
  }
  cout << count << endl;
  return 0;
  // std::cout << pow(9,(1.0/2.0))<< '\\n';
}


#include <stdio.h>

#define P 10000000
#define UNDEFINED -1

int CheckPrime(int v); // v????´???°??????1????????????
int GetPrime(int n);   // n??????????´???°????????????
int PRIME[P];          //?´???°?????????

int main() {
  int v = 0;
  int N = 0;
  scanf("%d", &N);
  int num = 0;

  for (int i = 0; i < P; i++) {
    PRIME[i] = UNDEFINED;
  }

  for (int i = 0; i < N; i++) {
    scanf("%d", &v);
    num += CheckPrime(v);
  }

  printf("%d\\n", num);

  return 0;
}

int CheckPrime(int v) {
  for (int i = 0; i < P; i++) {
    if (PRIME[i] == UNDEFINED) {
      PRIME[i] = GetPrime(i);
    }
    if (v == PRIME[i]) {
      return 1;
    }
    if (v % PRIME[i] == 0) {
      return 0;
    }
    if (v / 2 + 1 < PRIME[i]) {
      return 1;
    }
  }
  return 1;
}

int GetPrime(int n) {
  if (n > P) {
    printf("E\\n");
  }
  if (n == 0) {
    PRIME[0] = 2;
    return 2;
  }
  if (n == 1) {
    PRIME[1] = 3;
    return 3;
  }
  if (PRIME[n - 1] == UNDEFINED) {
    PRIME[n - 1] = GetPrime(n - 1);
  }

  int v = PRIME[n - 1] + 2;

  for (int i = 0; i < n; i++) {
    if (v % PRIME[i] == 0) {
      i = 0;
      v += 2;
    }
    if (v / 2 + 1 < PRIME[i]) {
      break;
    }
  }
  PRIME[n] = v;
  return v;
}

#include <math.h>
#include <stdio.h>

#define P 10000
#define UNDEFINED -1

int CheckPrime(int v); // v????´???°??????1????????????
int GetPrime(int n);   // n??????????´???°????????????
int PRIME[P];          //?´???°?????????

int main() {
  int v = 0;
  int N = 0;
  scanf("%d", &N);
  int num = 0;

  for (int i = 0; i < P; i++) {
    PRIME[i] = UNDEFINED;
  }

  for (int i = 0; i < N; i++) {
    scanf("%d", &v);
    num += CheckPrime(v);
  }

  printf("%d\\n", num);

  return 0;
}

int CheckPrime(int v) {
  for (int i = 0; i < P; i++) {
    if (PRIME[i] == UNDEFINED) {
      PRIME[i] = GetPrime(i);
    }
    if (v == PRIME[i]) {
      return 1;
    }
    if (v % PRIME[i] == 0) {
      return 0;
    }
    if (sqrt(v) + 1 < PRIME[i]) {
      return 1;
    }
  }
  return 1;
}

int GetPrime(int n) {
  if (n > P) {
    printf("E\\n");
  }
  if (n == 0) {
    PRIME[0] = 2;
    return 2;
  }
  if (n == 1) {
    PRIME[1] = 3;
    return 3;
  }
  if (PRIME[n - 1] == UNDEFINED) {
    PRIME[n - 1] = GetPrime(n - 1);
  }

  int v = PRIME[n - 1] + 2;

  for (int i = 0; i < n; i++) {
    if (v % PRIME[i] == 0) {
      i = 0;
      v += 2;
    }
    if (sqrt(v) + 1 < PRIME[i]) {
      break;
    }
  }
  PRIME[n] = v;
  return v;
}


#include <iostream>
using namespace std;
int isprime(int a) {
  if (a == 1 || a == 2)
    return 1;
  else
    for (int i = 2; i <= a / 2; i++) {
      if (a % i == 0)
        return 0;
      if (i == a / 2)
        return 1;
    }
}
int main() {
  int num;
  cin >> num;
  int a, sum = 0;
  for (int i = 0; i < num; i++) {
    cin >> a;
    sum += isprime(a);
  }
  cout << sum << endl;
  return 0;
}

#include <cmath>
#include <iostream>
using namespace std;
int isprime(int a) {
  int tmp = a / 10;

  if (a == 1 || a == 2)
    return 1;
  else
    for (int i = 2; i <= int(sqrt(a)) + 1; i++) {
      if (a % i == 0)
        return 0;
      else if (i == int(sqrt(a)) + 1)
        return 1;
    }
}
int main() {
  int num;
  cin >> num;
  int a, sum = 0;
  for (int i = 0; i < num; i++) {
    cin >> a;
    sum += isprime(a);
  }
  cout << sum << endl;
  return 0;
}


#include <stdio.h>

char checkTable[10000000001];

int findLimit(int num) {
  int i;
  for (i = 1; i * i <= num; i++)
    ;
  return i - 1;
}

int main() {
  int n, tmp, count = 0, limit;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) {
    scanf("%d", &tmp);
    if (checkTable[tmp] == 'Y')
      count++;
    else {
      limit = findLimit(tmp);
      for (int j = 2; j <= limit; j++) {
        if (tmp % j == 0) {
          checkTable[tmp] = 'Y';
          count++;
          break;
        }
      }
    }
  }
  printf("%d\\n", n - count);
}

#include <algorithm>
#include <cmath>
#include <stdio.h>

int main() {
  int n, tmp, count = 0, limit;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) {
    scanf("%d", &tmp);
    limit = sqrt(tmp);
    for (int j = 2; j <= limit; j++) {
      if (tmp % j == 0) {
        count++;
        break;
      }
    }
  }
  printf("%d\\n", n - count);
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define rep(n) for (int i = 0; i < (n); i++)
#define pb(n) push_back((n))

// typedef long long ll;

using namespace std;

// vector<bool> p(100000100,true);

// void makep(){
// 	for(int i=0; i<100000100; i++){
// 		if(i<2)p[i]=false;
// 		for(int j=2; j<=sqrt(i); j++){
// 			if(i%j==0){
// 				p[i]=false;
// 				break;
// 			}
// 		}
// 	}
// }

bool is_p(int n) {
  if (n < 2)
    return false;
  for (int i = 0; i <= sqrt(n); i++) {
    if (n % i == 0)
      return false;
  }
  return true;
}

int main() {
  int n, cnt = 0, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (is_p(a))
      cnt++;
  }
  cout << cnt << endl;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define rep(n) for (int i = 0; i < (n); i++)
#define pb(n) push_back((n))

// typedef long long ll;

using namespace std;

// vector<bool> p(100000100,true);

// void makep(){
// 	for(int i=0; i<100000100; i++){
// 		if(i<2)p[i]=false;
// 		for(int j=2; j<=sqrt(i); j++){
// 			if(i%j==0){
// 				p[i]=false;
// 				break;
// 			}
// 		}
// 	}
// }

bool is_p(int n) {
  if (n < 2)
    return false;
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0)
      return false;
  }
  return true;
}

int main() {
  int n, cnt = 0, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (is_p(a))
      cnt++;
  }
  cout << cnt << endl;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;

int const SIZ = 100000001;
bitset<SIZ> chk;

void sieve() {
  chk.set();
  chk.set(0, 0);
  chk.set(1, 0);
  for (int i = 4; i < SIZ; i += 2) {
    chk.set(i, 0);
  }
  for (int i = 3; i < SIZ; i += 2) {
    if (!chk[i])
      continue;
    for (int j = 2; i * j < SIZ; ++j) {
      chk.set(i * j, 0);
    }
  }
}

int main() {
  ios::sync_with_stdio(false);

  sieve();

  int n;
  cin >> n;
  int m, ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> m;
    if (chk[m]) {
      ++ans;
      chk[m] = 0;
    }
  }
  cout << ans << endl;

  return 0;
}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;

int const SIZ = 100000001;
bitset<SIZ> chk;

void sieve() {
  chk.set();
  chk.set(0, 0);
  chk.set(1, 0);
  for (int i = 4; i < SIZ; i += 2) {
    chk.set(i, 0);
  }
  for (int i = 3; i * i < SIZ; i += 2) {
    if (!chk[i])
      continue;
    for (int j = 2; i * j < SIZ; ++j) {
      chk.set(i * j, 0);
    }
  }
}

int main() {
  ios::sync_with_stdio(false);

  sieve();

  int n;
  cin >> n;
  int m, ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> m;
    if (chk[m]) {
      ++ans;
      chk[m] = 0;
    }
  }
  cout << ans << endl;

  return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;

int const SIZ = 10001;
bitset<SIZ> isprime;

void sieve() {
  isprime.set();
  isprime.set(0, 0);
  isprime.set(1, 0);
  for (int i = 4; i < SIZ; i += 2) {
    isprime.set(i, 0);
  }
  for (int i = 3; i * i < SIZ; i += 2) {
    if (!isprime[i])
      continue;
    for (int j = 2; i * j < SIZ; ++j) {
      isprime.set(i * j, 0);
    }
  }
}

int main() {
  // cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin >> n;

  sieve();

  int m, ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> m;
    if (isprime[m]) {
      ++ans;
      isprime.set(m, 0);
    }
  }
  cout << ans << endl;

  return 0;
}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;

int const SIZ = 10001;

bitset<SIZ> sieve;
vector<int> primes;

void prepare() {
  sieve.set();
  sieve.set(0, 0);
  sieve.set(1, 0);
  for (int i = 4; i < SIZ; i += 2) {
    sieve.set(i, 0);
  }
  for (int i = 3; i * i < SIZ; i += 2) {
    if (!sieve[i]) {
      continue;
    }
    for (int j = 2; i * j < SIZ; ++j) {
      sieve.set(i * j, 0);
    }
  }

  for (int i = 0; i < SIZ; ++i) {
    if (sieve[i]) {
      primes.push_back(i);
    }
  }
}

int main() {
  // cin.tie(0);
  ios::sync_with_stdio(false);

  int n;
  cin >> n;

  prepare();

  unordered_map<int, int> checked;
  int m, ans = 0;
  for (int i = 0; i < n; ++i) {
    cin >> m;
    if (checked[m]) {
      continue;
    }
    if (m < SIZ && sieve[m]) {
      ++ans;
      checked[m] = 1;
      continue;
    }
    bool isprime = true;
    for (int i = 0; i < (int)primes.size(); ++i) {
      if (m % primes[i] == 0) {
        isprime = false;
        break;
      }
    }
    if (isprime) {
      ++ans;
      checked[m] = 1;
    }
  }
  cout << ans << endl;

  return 0;
}


#include <iostream>
using namespace std;
int main(void) {
  bool flag;
  int n, k = 0, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    flag = false;
    for (int j = a - 1; 1 < j; j--) {
      if (a % j == 0) {
        flag = true;
        break;
      }
    }
    if (flag == false)
      k += 1;
  }
  cout << k << endl;
  return 0;
}

#include <iostream>
using namespace std;
int main(void) {
  bool flag;
  int n, k = 0, a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    flag = false;
    for (int j = 2; j * j <= a; j++) {
      if (a % j == 0) {
        flag = true;
        break;
      }
    }
    if (flag == false)
      k += 1;
  }
  cout << k << endl;
  return 0;
}


#include <iostream>
using namespace std;

bool primeNum(int num) {
  if (num % 2 == 0) {
    for (int i = 2; i <= num / 2; i++) {
      if (num % i == 0)
        return false;
    }
  } else {
    for (int i = 3; i <= num / 2; i += 2) {
      if (num % i == 0)
        return false;
    }
  }
  return true;
}

int main(void) {

  int n;
  int count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (primeNum(a))
      count++;
  }
  cout << count << endl;

  return 0;
}

#include <iostream>
#include <math.h>
using namespace std;

bool primeNum(int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;

  for (int i = 3; i <= sqrt(num); i += 2) {
    if (num % i == 0)
      return false;
  }
  return true;
}

int main(void) {

  int n;
  int count = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (primeNum(a))
      count++;
  }
  cout << count << endl;

  return 0;
}


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

bool isPrime(int a) {
  for (int i = 2; i < a; i++) {
    if (a % i == 0) {
      return false;
    }
  }

  return true;
}

int main() {

  int n;
  cin >> n;

  int sum = 0;
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (isPrime(x))
      sum += 1;
  }

  cout << sum << endl;

  return 0;
}

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

bool isPrime(int a) {
  for (int i = 2; i <= sqrt(a); i++) {
    if (a % i == 0) {
      return false;
    }
  }

  return true;
}

int main() {

  int n;
  cin >> n;

  int sum = 0;
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (isPrime(x))
      sum += 1;
  }

  cout << sum << endl;

  return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int count = 0, tmp, n;
  bool f, flag[10003] = {};
  flag[2] = true;
  for (int i = 3; i < 10002; i += 2) {
    f = true;
    for (int j = 3; j < (int)sqrt(i) + 1; j += 2) {
      if (i % j == 0) {
        f = false;
        break;
      }
    }
    flag[i] = f;
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (flag[tmp])
      count++;
  }
  cout << count << endl;
}

#include <iostream>
#include <math.h>
using namespace std;

bool isprime(int num) {
  if (num == 2)
    return true;
  if (num % 2 == 0)
    return false;
  for (int j = 3; j < (int)sqrt(num) + 2; j += 2) {
    if (num % j == 0)
      return false;
  }
  return true;
}
int main() {
  int count = 0, tmp, n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (isprime(tmp))
      count++;
  }
  cout << count << endl;
}


#include <iostream>
using namespace std;
int main() {
  // def
  int n, j, sum = 0;
  cin >> n;
  int num[n];
  for (int i = 0; i < n; i++) {
    cin >> num[i];
  }

  // equation
  for (int i = 0; i < n; i++) {
    for (j = 2; j < num[i]; j++) {
      if (num[i] % j == 0) {
        break;
      }
    }
    if (j == num[i]) {
      sum++;
    }
  }

  // output
  cout << sum << endl;

  return 0;
}

#include <cmath>
#include <iostream>
using namespace std;
int main() {
  // def
  int n, j, sum = 0;
  cin >> n;
  int num[n];
  for (int i = 0; i < n; i++) {
    cin >> num[i];
  }

  // equation
  for (int i = 0; i < n; i++) {
    for (j = 2; j < sqrt(num[i]); j++) {
      if (num[i] % j == 0) {
        break;
      }
    }
    if (j > sqrt(num[i])) {
      sum++;
    }
  }

  // output
  cout << sum << endl;

  return 0;
}


#define FOR(i, min, max) for (int(i) = (min); (i) < (max); (i)++)

#include <algorithm>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
using namespace std;

int main() {
  int n, c = 0;
  cin >> n;
  FOR(i, 0, n) {
    int r;
    cin >> r;
    if (r == 2 || r == 3) {
      c++;
      continue;
    }
    if (r > 1 && (r % 6 == 5 || r % 6 == 1)) {
      bool ch = true;
      FOR(j, 2, r / 2) {
        if (r % j == 0) {
          ch = false;
          break;
        }
      }
      if (ch)
        c++;
    }
  }
  cout << c << endl;
  return 0;
}

#define FOR(i, min, max) for (int(i) = (min); (i) < (max); (i)++)

#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;

int main() {
  int n, c = 0;
  cin >> n;
  FOR(i, 0, n) {
    int r;
    cin >> r;
    if (r == 2 || r == 3) {
      c++;
      continue;
    }
    if (r > 1 && (r % 6 == 5 || r % 6 == 1)) {
      bool ch = true;
      FOR(j, 2, (int)sqrt(r) + 1) {
        if (r % j == 0) {
          ch = false;
          break;
        }
      }
      if (ch)
        c++;
    }
  }
  cout << c << endl;
  return 0;
}