#include <iostream>
using namespace std;

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

  return true;
}

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

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

  return 0;
}

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

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;
}

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

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

  return 0;
}


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

int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  if (a >= b) {
    gcd(b, a % b);
  } else {
    gcd(a, b % a);
  }
}

int main() {
  int N, d = 1;
  int sum = 0;
  cin >> N;
  int *A = (int *)malloc(sizeof(int) * (N + 1));
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
    for (int k = 2; k < A[i]; k++) {
      d = gcd(k, A[i]);
      if (d != 1) {
        break;
      }
    }
    if (d == 1) {
      sum++;
    }
  }
  cout << sum << "\\n";
  return 0;
}

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

int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  if (a >= b) {
    gcd(b, a % b);
  } else {
    gcd(a, b % a);
  }
}

int main() {
  int N, d = 1;
  int sum = 0;
  cin >> N;
  int *A = (int *)malloc(sizeof(int) * (N + 1));
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
    for (int k = 2; k <= floor(sqrt(A[i])); k++) {
      d = gcd(k, A[i]);
      if (d != 1) {
        break;
      }
    }
    if (d == 1) {
      sum++;
    }
  }
  cout << sum << "\\n";
  free(A);
  return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int prime(int num) {
  if (num == 2 || num == 3 || num == 5) {
    return 1;
  }
  for (int k = 2; k <= (num + 1) / 2; k++) {
    if (num % k == 0) {
      return 0;
    }
  }
  return 1;
}

int main() {
  int N;
  cin >> N;
  int count = 0;
  for (int i = 0; i < N; i++) {
    int num;
    cin >> num;
    count += prime(num);
  }

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

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int prime(int num) {
  if (num == 2 || num == 3)
    return 1;
  if ((num % 2) * (num % 3) == 0)
    return 0;

  if (num <= 4) {
    return 0;
  }
  for (int k = 3; k <= int(sqrt(num)) + 2; k += 2) {
    if (num % k == 0)
      return 0;
  }
  return 1;
}

int main() {
  int N;
  cin >> N;
  int count = 0;
  for (int i = 0; i < N; i++) {
    int num;
    cin >> num;
    count += prime(num);
  }

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


/*     *******************Bismillahir Rahmanir Rahim************************
                          MD. ASFAKUL GHANI!
                          *ProMAGFAT*!
 SECRET_warning :)->FAT   CSE-25!
                          JAHANGIRNAGAR UNIVERSITY!
                          Dhaka,Bangladesh!
*/

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

#define fasterIO                                                               \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL)
#define Im int main()
#define ll long long
#define sc scanf
#define pf printf
#define rn0 return 0
#define rn return
#define f0(i, n) for (ll i = 0; i < n; i++)
#define f1(i, n) for (ll i = 1; i <= n; i++)
#define f2(i, n) for (ll i = n - 1; i >= 0; i--)
#define pi 2 * acos(0.0)
#define modulo 1000003
#define dd double
#define PI 3.14159265358979
#define pi 2 * acos(0.0)
#define p_b push_back
#define ps push

/*
ll for_binarySearch(ll a,ll b,ll aa[],ll x){while(a<=b){ll
mid=(a+b)/2;if(aa[mid]==x) return 1;else if(aa[mid] > x) b=mid-1;else
a=mid+1;}return -1;} ll for_gcd(ll a,ll b){if(a==0) return b;else return
for_gcd(b%a,a);} ll for_prime(ll x){for (ll i=2;i*i<=x;i++){if(x%i==0) return
0;}return 1;} void for_swap(char *x,char *y){char temp;temp=*x;*x=*y;*y=temp;}
ll for_big_mod(ll b,ll p,ll m){if(p==0) return 1;else if(p%2==0){ll
k=for_big_mod(b,p/2,m);return (k*k)%m;}else return
((b%m)*(for_big_mod(b,p-1,m)))%m;} ll for_josephus(ll n,ll k){if(n==1) return
1;return (for_josephus(n-1,k)+k-1)%n+1;} ll for_gcdExtended(ll a,ll b,ll *x,ll
*y){if(a==0){*x=0;*y=1;return b;}ll x1,y1;ll
gcd=for_gcdExtended(b%a,a,&x1,&y1);*x=y1-(b/a)*x1;*y=x1;return gcd;}
*/
/*
void debug1()
{
    cout << "***" << endl;
}

void debug11(ll n)
{
    cout << n << endl;
}
*/

#define MAX 100000005
map<ll, ll> vis;

void FAT_sv() {
  vis[0] = vis[1] = 1;
  for (ll i = 4; i <= MAX - 2; i += 2)
    vis[i] = 1;
  for (ll i = 3; i * i <= MAX - 2; i += 2) {
    if (!vis[i]) {
      for (ll j = (i * i); j <= MAX - 2; j += (i + i))
        vis[j] = 1;
    }
  }
}

Im {
  /*#ifdef FAT
     freopen("input.txt","w",stdin);
  #endif // FAT*/

  fasterIO;
  FAT_sv();
  ll n;
  cin >> n;
  ll a1[n + 5];
  ll c1 = 0;
  for (ll i = 0; i < n; i += 1) {
    cin >> a1[i];
    if (vis[a1[i]] == 0)
      c1 += 1;
  }
  cout << c1 << endl;

  // main();

  rn0;
}

/*     *******************Bismillahir Rahmanir Rahim************************
                          MD. ASFAKUL GHANI!
                          *ProMAGFAT*!
 SECRET_warning :)->FAT   CSE-25!
                          JAHANGIRNAGAR UNIVERSITY!
                          Dhaka,Bangladesh!
*/

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

#define fasterIO                                                               \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL)
#define Im int main()
#define ll long long
#define sc scanf
#define pf printf
#define rn0 return 0
#define rn return
#define f0(i, n) for (ll i = 0; i < n; i++)
#define f1(i, n) for (ll i = 1; i <= n; i++)
#define f2(i, n) for (ll i = n - 1; i >= 0; i--)
#define pi 2 * acos(0.0)
#define modulo 1000003
#define dd double
#define PI 3.14159265358979
#define pi 2 * acos(0.0)
#define p_b push_back
#define ps push

/*
ll for_binarySearch(ll a,ll b,ll aa[],ll x){while(a<=b){ll
mid=(a+b)/2;if(aa[mid]==x) return 1;else if(aa[mid] > x) b=mid-1;else
a=mid+1;}return -1;} ll for_gcd(ll a,ll b){if(a==0) return b;else return
for_gcd(b%a,a);} ll for_prime(ll x){for (ll i=2;i*i<=x;i++){if(x%i==0) return
0;}return 1;} void for_swap(char *x,char *y){char temp;temp=*x;*x=*y;*y=temp;}
ll for_big_mod(ll b,ll p,ll m){if(p==0) return 1;else if(p%2==0){ll
k=for_big_mod(b,p/2,m);return (k*k)%m;}else return
((b%m)*(for_big_mod(b,p-1,m)))%m;} ll for_josephus(ll n,ll k){if(n==1) return
1;return (for_josephus(n-1,k)+k-1)%n+1;} ll for_gcdExtended(ll a,ll b,ll *x,ll
*y){if(a==0){*x=0;*y=1;return b;}ll x1,y1;ll
gcd=for_gcdExtended(b%a,a,&x1,&y1);*x=y1-(b/a)*x1;*y=x1;return gcd;}
*/
/*
void debug1()
{
    cout << "***" << endl;
}

void debug11(ll n)
{
    cout << n << endl;
}
*/

bool FAT_chk(ll n) {
  for (ll i = 2; i * i <= n; i += 1) {
    if (n % i == 0)
      rn false;
  }
  rn true;
}

Im {
  /*#ifdef FAT
     freopen("input.txt","w",stdin);
  #endif // FAT*/

  fasterIO;
  ll n;
  cin >> n;
  ll a1[n + 5];
  ll c1 = 0;
  for (ll i = 0; i < n; i += 1) {
    cin >> a1[i];
    if (FAT_chk(a1[i]))
      c1 += 1;
  }
  cout << c1 << endl;

  // main();

  rn0;
}


#include <iostream>
using namespace std;

int main() {
  int n, a[11000], cnt = 0;
  cin >> n;
  for (int i = 0; i < n; ++i)
    cin >> a[i];

  for (int i = 0; i < n; ++i) {
    bool sosu = true;
    for (int j = 2; j < a[i]; ++j) {
      if (a[i] % j == 0) {
        sosu = false;
        break;
      }
    }
    if (sosu)
      ++cnt;
  }

  cout << cnt << endl;

  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int n, a[11000], cnt = 0;
  cin >> n;
  for (int i = 0; i < n; ++i)
    cin >> a[i];

  for (int i = 0; i < n; ++i) {
    bool sosu = true;
    for (int j = 2; j * j <= a[i]; ++j) {
      if (a[i] % j == 0) {
        sosu = false;
        break;
      }
    }
    if (sosu)
      ++cnt;
  }

  cout << cnt << endl;

  return 0;
}


#include <cstdio>
#include <iostream>

using namespace std;

int main(void) {

  int N, inp, cnt = 0;
  bool f;

  cin >> N;

  for (int i = 0; i < N; i++) {
    cin >> inp;
    if (inp == 0 || inp == 1)
      f = false;
    else if (inp == 2)
      f = true;
    else if (inp % 2 != 0) {
      for (int j = 3; j <= inp; j += 2) {
        if (inp == j) {
          f = true;
          break;
        }
        if (inp % j == 0) {
          f = false;
          break;
        }
      }
    } else
      f = false;
    if (f)
      cnt++;
  }

  cout << cnt << endl;

  return 0;
}

#include <cmath>
#include <cstdio>
#include <iostream>

using namespace std;

int main(void) {

  int N, inp, cnt = 0;
  bool f;

  cin >> N;

  for (int i = 0; i < N; i++) {
    cin >> inp;
    f = true;
    for (int i = 2; i <= sqrt((double)inp); i++) {
      if (inp % i == 0) {
        f = false;
        break;
      }
    }
    if (f)
      cnt++;
  }

  cout << cnt << endl;

  return 0;
}


// last edited at 26.8.2015 by charis

#include <iostream>
using namespace std;
/* Time Limit Exceeded
bool isPrime(int x){
        if(x<=1) return false;
        for(int i=2; i<x; i++){
                if(x%i==0) return false;
        }
        return true;
}
*/

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

int main() {
  int N;
  cin >> N;
  int A[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int c = 0;
  for (int i = 0; i < N; i++) {
    if (isPrime(A[i]))
      c++;
  }
  cout << c << endl;
  return 0;
}

// last edited at 26.8.2015 by charis

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

/* Time Limit Exceeded
bool isPrime(int x){
        if(x<=1) return false;
        for(int i=2; i<x; i++){
                if(x%i==0) return false;
        }
        return true;
}
*/

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

int main() {
  int N;
  cin >> N;
  int A[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int c = 0;
  for (int i = 0; i < N; i++) {
    if (isPrime(A[i]))
      c++;
  }
  cout << c << endl;
  return 0;
}


#include <iostream>

using namespace std;

int main() {
  int n;
  cin >> n;
  int x;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 2) {
      sum++;
      continue;
    }
    if (x % 2 == 0) {
      continue;
    }
    int d = 3;
    while (1) {
      if (x % d == 0) {
        if (x == d) {
          sum++;
          break;
        } else {
          break;
        }
      }
      d = d + 2;
    }
  }
  cout << sum << endl;
}

#include <cmath>
#include <iostream>

using namespace std;

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

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

  int x;
  int prime = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (is_prime(x))
      prime++;
  }
  cout << prime << endl;
}


#include <iostream>

using namespace std;

int N;

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

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

  return true;
}

int main() {
  cin >> N;

  int count = 0;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (isPrime(a))
      count++;
  }

  cout << count << endl;

  return 0;
}

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

using namespace std;

int N;

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

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

  return true;
}

int main() {
  cin >> N;

  int count = 0;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (isPrime(a))
      count++;
  }

  cout << count << endl;

  return 0;
}


#include <cassert>
#include <iostream>
#include <string.h>

#define MAX_N (100000000)

bool ptable[MAX_N];

void init_ptable() {
  memset(ptable, false, MAX_N * sizeof(bool));

  ptable[0] = true;
  int base = 2;

  while (base <= MAX_N / 2) {
    // std::cout << "base: " << base << std::endl;
    for (int cur = base * 2; cur <= MAX_N; cur += base) {
      assert(1 <= cur && cur <= MAX_N);
      ptable[cur - 1] = true;
    }
    ++base;
    while (ptable[base - 1] == true)
      ++base;
  }
  return;
}

void dump_ptable() {
  for (int i = 0; i < MAX_N; i++) {
    std::cout << ptable[i];
  }
  return;
}

int main(void) {
  int N;
  std::cin >> N;
  int *a;
  a = new int[N];
  for (int i = 0; i < N; i++) {
    std::cin >> a[i];
  }
  // std::cout << "input success" << std::endl;

  init_ptable();
  // dump_ptable();

  // std::cout << "ptable scan success" << std::endl;
  int num_of_prime = 0;
  for (int i = 0; i < N; i++) {
    if (ptable[a[i] - 1] == false)
      ++num_of_prime;
  }

  // std::cout << "ptable check success" << std::endl;
  std::cout << num_of_prime << std::endl;

  return 0;
}

#include <cassert>
#include <iostream>

#define MAX_N (100000000)

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

int main(void) {
  int N;
  std::cin >> N;
  int *a;
  a = new int[N];
  for (int i = 0; i < N; i++) {
    std::cin >> a[i];
  }

  int num_of_prime = 0;
  for (int i = 0; i < N; i++) {
    if (is_prime(a[i]))
      ++num_of_prime;
  }

  std::cout << num_of_prime << std::endl;

  return 0;
}


#include <iostream>

using namespace std;

bool primenum(int x);

int main() {
  int n;
  int i;
  int num[10000];
  int ans = 0;

  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> num[i];
  }

  for (i = 0; i < n; i++) {
    if (primenum(num[i]) == true)
      ans++;
  }

  cout << ans << "\\n";
}

bool primenum(int x) {
  int j = 3;

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

  while (j * j <= x) {
    if (x % j == 0) {
      return (false);
    }
  }

  return (true);
}

#include <iostream>

using namespace std;

bool primenum(int x);

int main() {
  int n;
  int i;
  int num[10000];
  int ans = 0;

  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> num[i];
  }

  for (i = 0; i < n; i++) {
    if (primenum(num[i]) == true)
      ans++;
  }

  cout << ans << "\\n";
}

bool primenum(int x) {
  int j = 3;

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

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

  return (true);
}


#include <iostream>
using namespace std;

int c = 0; // count
void prime(int x);

int main() {
  int n; // how many numbers
  int x;

  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x; // stop endl
    prime(x);
  }
  cout << c << endl;

  return 0;
}

void prime(int x) {
  if (x == 2)
    c++;
  if (x % 2 != 0 && x > 2) {
    for (int i = 3; i <= x; i++) {
      if (x % i == 0 && i < x)
        break;
      if (i == x)
        c++;
    }
  }
}

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

int prime(int x);

int main() {
  int n; // how many numbers
  int x;
  int cou = 0;

  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x; // stop endl
    cou += prime(x);
  }
  cout << cou << endl;

  return 0;
}

int prime(int x) {
  int c = 0;

  if (x <= 1)
    return c;
  else if (x == 2)
    return ++c; // c++ だとreturnして++
  else {
    for (int i = 2; i <= sqrt(x); i++) {
      if (x % i == 0)
        return c;
    }
    return ++c;
  }
}


#include <iostream>

using namespace std;

int main() {
  int n, count = 0;
  cin >> n;
  int list[n];
  for (int i = 0; i < n; i++)
    cin >> list[i];

  for (int i = 0; i < n; i++) {
    for (int j = 2; j <= list[i]; j++) {
      if (j == list[i]) {
        count++;
        break;
      }
      if (j >= 3 && list[i] % 2 == 0)
        continue;
      if (list[i] % j == 0)
        break;
    }
  }
  cout << count << endl;
}

#include <complex>
#include <iostream>

using namespace std;

int main() {
  int n, count = 0, i, j;
  cin >> n;
  int list[n];
  for (i = 0; i < n; i++)
    cin >> list[i];

  for (i = 0; i < n; i++) {
    if (list[i] <= 1)
      continue;
    if (list[i] == 2 || list[i] == 3) {
      count++;
      continue;
    }
    if (list[i] > 3 && list[i] % 2 == 0)
      continue;
    for (j = 2; j <= sqrt(list[i]); j++)
      if (list[i] % j == 0)
        break;
    if (j > sqrt(list[i]))
      count++;
  }
  cout << count << endl;
}


#include <iostream>
#include <vector>

using namespace std;

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

  vector<int> v(100000000 + 1, -1);
  for (int i = 2; i < v.size(); ++i) {
    if (v[i] == -1) {
      v[i] = 1;
      for (int j = i * 2; j < v.size(); j += i) {
        v[j] = 0;
      }
    }
  }

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

#include <iostream>

using namespace std;

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

  auto isPrime = [](int n) {
    if (n < 2) {
      return false;
    } else 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 count{0};
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    if (isPrime(x)) {
      count += 1;
    }
  }
  cout << count << endl;
}


#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  int prime = 0;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    for (int j = 2; j <= A[i]; j++) {
      if (A[i] == 2) {
        prime++;
        break;
      }
      if (A[i] % j == 0) {
        break;
      }
      if (j == A[i] - 1) {
        prime++;
      }
    }
  }
  cout << prime << endl;
}

#include <cmath>
#include <iostream>

using namespace std;

bool isPrime(int x) {
  if (x == 2) {
    return true;
  }
  if (x == 1 || x % 2 == 0) {
    return false;
  }

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

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


#include <iostream>
using namespace std;

bool check_prime(int n) {
  int i = 2;
  bool flg = true;
  while (i < n) {
    if (n % i == 0) {
      flg = false;
      break;
    } else {
      i++;
    }
  }
  return flg;
}

int main() {
  int N;
  const int MAX_N = 10000;

  cin >> N;

  int arr[MAX_N];

  for (int i = 0; i < N; i++) {
    cin >> arr[i];
  }

  int count = 0;
  for (int i = 0; i < N; i++) {
    if (check_prime(arr[i]) == true) {
      count++;
    }
  }
  cout << count << endl;
}

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

bool isPrime(int n) {

  if (n == 2)
    return true;
  else if (n % 2 == 0)
    return false;

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

int main() {
  int N, element, count = 0;

  cin >> N;

  for (int i = 0; i < N; i++) {
    cin >> element;
    if (isPrime(element) == true) {
      count++;
      // cout << element << endl;
    }
  }
  cout << count << endl;
}


#include <iostream>
using namespace std;

int main() {

  int N, num, i, j, judge, count = 0;

  cin >> N;

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

    judge = 1;
    cin >> num;

    for (j = 2; j <= num / 2; j++)
      if (num % j == 0)
        judge++;
    if (judge == 1)
      count++;
  }

  cout << count << endl;
}

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

int isprime(int);

int main() {

  int i, n, x, count = 0;

  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> x;
    count += isprime(x);
  }

  cout << count << endl;

  return 0;
}

int isprime(int x) {

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

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

  return 1;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

bool is_prime[100000001];
int main() {
  memset(is_prime, 1, sizeof(is_prime));
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i <= 100000000; i++) {
    if (is_prime[i]) {
      for (int j = i * 2; j <= 100000000; j += i)
        is_prime[j] = false;
    }
  }
  int n;
  scanf("%d", &n);
  int cnt = 0;
  rep(i, n) {
    int a;
    scanf("%d", &a);
    if (is_prime[a])
      cnt++;
  }
  printf("%d\\n", cnt);
}

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

int main() {
  int n;
  scanf("%d", &n);
  int cnt = 0;
  rep(i, n) {
    int a;
    scanf("%d", &a);
    if (a == 1)
      continue;
    bool ok = true;
    for (int j = 2; j * j <= a; j++) {
      if (a % j == 0) {
        ok = false;
        break;
      }
    }
    if (ok)
      cnt++;
  }
  printf("%d\\n", cnt);
}


#include <iostream>

using namespace std;

int couent = 0;
int keisann(int a) {
  for (int i = 2; i < a; i++) {
    if (a % i == 0) {
      return 0;
    }
  }
  couent++;
}
int main() {
  int dataset;
  cin >> dataset;
  for (size_t i = 0; i < dataset; i++) {
    int a;
    cin >> a;
    keisann(a);
  }
  cout << couent << endl;
}

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

using namespace std;

int couent = 0;
int keisann(int a) {
  if (a == 2) {
    couent++;
  }
  if (a % 2 == 0) {
    return 0;
  }
  int v = sqrt(a);
  for (int i = 3; i <= v; i += 2) {
    if (a % i == 0) {
      return 0;
    }
  }
  couent++;
}
int main() {
  int dataset;
  cin >> dataset;
  for (size_t i = 0; i < dataset; i++) {
    int a;
    cin >> a;
    keisann(a);
  }
  cout << couent << endl;
}


#include <algorithm>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define ll long long
#define vvi vector<vector<int>>
#define vi vector<int>
#define All(X) X.begin(), X.end()
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

#define intmax 100000003
bool isprime[intmax];
void makeprime(int datasize) { /*??¨???????????????????????????*/
  REP(i, datasize) if (i % 2 != 0) isprime[i] = true;
  isprime[1] = false;
  isprime[2] = true;
  for (ll int i = 3; i < sqrt(datasize); i += 2) {
    for (ll int j = i + 2; j < datasize; j += 2) {
      if (j % i == 0)
        isprime[j] = false;
    }
  }
}

int main() {
  int n;
  cin >> n;
  int cnt = 0;
  ll int mmax = -1;
  ll int data[10001];
  REP(i, n) {
    ll int tmp;
    cin >> tmp;
    data[i] = tmp;
    mmax = max(mmax, tmp);
  }
  makeprime(mmax + 1);
  REP(i, n) {
    if (isprime[data[i]])
      cnt++;
  }
  cout << cnt << endl;
}

#include <algorithm>
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define ll long long
#define vvi vector<vector<int>>
#define vi vector<int>
#define All(X) X.begin(), X.end()
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define pb push_back
#define pii pair<int, int>
#define mp make_pair
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

#define intmax 1299710
int isprime[intmax];
void makeprime() {
  REP(i, intmax) if (i % 2 != 0) isprime[i] = true;
  isprime[1] = false;
  isprime[2] = true;
  for (ll int i = 3; i < sqrt(intmax); i += 2) {
    for (ll int j = i + 2; j < intmax; j += 2) {
      if (j % i == 0)
        isprime[j] = false;
    }
  }
}
int main() {
  int cnt = 0;
  int n;
  cin >> n;
  REP(i, n) {
    ll int tmp;
    cin >> tmp;
    if (tmp == 1)
      continue;
    if (tmp == 2 || tmp == 3) {
      cnt++;
      continue;
    }
    if (tmp % 2 == 0)
      continue;
    bool flag = true;
    for (ll int j = 3; j < sqrt(tmp) + 1; j += 2) {
      if (tmp % j == 0) {
        flag = false;
      }
    }
    if (flag)
      cnt++;
  }
  cout << cnt << endl;
}


#include <algorithm>  //std::sort
#include <bitset>     //std::bitset
#include <chrono>     //std::chrono(C++11)
#include <cmath>      //abs,std::pow,sqrt,sin,cos,round,floor,ceil
#include <cstdlib>    //abs
#include <ctime>      //localtime_s
#include <fstream>    //std::ifstream,std::ofstream
#include <functional> //std::greater
#include <iomanip>    //std::setprecision,std::setw,std::setfill
#include <iostream>   //std::cout, std::cin
#include <numeric>    //std::accumulate
#include <queue>      //std::queue
#include <random>     //std::random(C++11)
#include <string>     //std::string,std::to_string(C++11)
#include <valarray>   //std::valarray
#include <vector>     //std::vector

const static double de_PI = 3.14159265358979323846;
const static int de_MOD = 1000000007;
const static int de_MAX = 999999999;

bool Judge_PrimeNumber(const int a) {

  if (a == 2) {
    return true;
  }
  if (a % 2 == 0) {
    return false;
  }

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

  return true;
}

int main(void) {

  // std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());
  // std::ofstream ofs("456.csv");
  // std::chrono::system_clock::time_point t_st =
  // std::chrono::system_clock::now();

  int N = 0, ans = 0;
  std::cin >> N;

  for (int i = 0; i < N; i++) {
    int temp = 0;
    std::cin >> temp;
    if (Judge_PrimeNumber((temp))) {
      ans++;
    }
  }

  std::cout << ans << std::endl;

  // std::chrono::system_clock::time_point t_ed =
  // std::chrono::system_clock::now(); std::cout <<
  // std::chrono::duration_cast<std::chrono::milliseconds>(t_ed - t_st).count()
  // << "ms" << std::endl;
}

#include <algorithm>  //std::sort
#include <bitset>     //std::bitset
#include <chrono>     //std::chrono(C++11)
#include <cmath>      //abs,std::pow,sqrt,sin,cos,round,floor,ceil
#include <cstdlib>    //abs
#include <ctime>      //localtime_s
#include <fstream>    //std::ifstream,std::ofstream
#include <functional> //std::greater
#include <iomanip>    //std::setprecision,std::setw,std::setfill
#include <iostream>   //std::cout, std::cin
#include <numeric>    //std::accumulate
#include <queue>      //std::queue
#include <random>     //std::random(C++11)
#include <string>     //std::string,std::to_string(C++11)
#include <valarray>   //std::valarray
#include <vector>     //std::vector

const static double de_PI = 3.14159265358979323846;
const static int de_MOD = 1000000007;
const static int de_MAX = 999999999;

bool Judge_PrimeNumber(const int a) {

  if (a < 2) {
    return false;
  }
  if (a == 2) {
    return true;
  }
  if (a % 2 == 0) {
    return false;
  }

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

int main(void) {

  // std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());
  // std::ofstream ofs("456.csv");
  // std::chrono::system_clock::time_point t_st =
  // std::chrono::system_clock::now();

  int N = 0, ans = 0;
  std::cin >> N;

  for (int i = 0; i < N; i++) {
    int temp = 0;
    std::cin >> temp;
    if (Judge_PrimeNumber((temp))) {
      ans++;
    }
  }

  std::cout << ans << std::endl;

  // std::chrono::system_clock::time_point t_ed =
  // std::chrono::system_clock::now(); std::cout <<
  // std::chrono::duration_cast<std::chrono::milliseconds>(t_ed - t_st).count()
  // << "ms" << std::endl;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
  int pri[100000001] = {};
  pri[2] = 1;
  int f = 0;
  for (int i = 3; i < 100000001; i++) {
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        f = 1;
        break;
      }
    }
    if (f == 0)
      pri[i] = 1;
  }
  int n;
  cin >> n;
  int co = 0;
  for (int i = 0; i < n; i++) {
    int nu;
    cin >> nu;
    if (pri[nu])
      co++;
  }
  cout << co << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int co = 0;
  for (int i = 0; i < n; i++) {
    int nu;
    cin >> nu;
    int f = 0;
    for (int i = 2; i * i <= nu; i++) {
      if (nu % i == 0) {
        f = 1;
        break;
      }
    }
    if (!f)
      co++;
  }
  cout << co << endl;
  return 0;
}


#include <iostream>

const int MAX_N = 10000;

int main() {
  int n = 0;
  int numbers[MAX_N] = {0};

  std::cin >> n;

  int count = n;
  int max = 0;

  for (int i = 0; i < n; i++) {
    std::cin >> numbers[i];

    if ((numbers[i] >= 4) && ((numbers[i] % 2) == 0)) {
      numbers[i] = -1;
      count--;
    }

    if (numbers[i] > max) {
      max = numbers[i];
    }
  }

  for (int i = 2; i < (max / 2); i++) {
    for (int j = 0; j < n; j++) {
      if ((numbers[j] < 0) || (numbers[j] < i)) {
        continue;
      }

      int step = i;

      for (int k = i + i; k <= max; k += step) {
        if (numbers[j] == k) {
          numbers[j] = -1;
          count--;
        }
      }
    }
  }

  // for (int i = 0; i < n; i++) {
  //   std::cout << numbers[i] << std::endl;
  // }

  std::cout << count << std::endl;

  return 0;
}

#include <cmath>
#include <iostream>

const int MAX_N = 10000;

int main() {
  int n = 0;
  int numbers[MAX_N] = {0};

  std::cin >> n;

  int count = n;

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

    std::cin >> x;

    if (x == 2) {
      continue;
    }

    if ((x > 2) && ((x % 2) == 0)) {
      count--;
    } else {
      numbers[i] = x;
    }
  }

  for (int i = 0; i < n; i++) {
    if (numbers[i] == 0) {
      continue;
    }

    int v = numbers[i];
    int max = std::sqrt(v);

    for (int j = 3; j <= max; j += 2) {
      if ((v % j) == 0) {
        count--;
        numbers[i] = 0;

        break;
      }
    }
  }

  // for (int i = 0; i < n; i++) {
  //   std::cout << numbers[i] << std::endl;
  // }

  std::cout << count << std::endl;

  return 0;
}


#include <iostream>
using namespace std;
int main() {
  long n;
  long a[10000];
  int ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    int check = 0;
    for (int j = 1; j <= a[i]; ++j) {
      if (a[i] % j == 0)
        check++;
    }
    if (check == 2)
      ans++;
  }
  cout << ans << endl;
  return 0;
}

#include <iostream>
using namespace std;
int main() {
  long n;
  long a[10000];
  int ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    int check = 0;
    for (int j = 1; j * j <= a[i]; ++j) {
      if (a[i] % j == 0)
        check++;
    }
    if (check == 1)
      ans++;
  }
  cout << ans << endl;
  return 0;
}


#include <stdbool.h>
#include <stdio.h>

int main(void) {
  int n;
  scanf("%d", &n);
  int x[n];
  int ans = 0;
  int max = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
    if (x[i] > max) {
      max = x[i];
    }
  }
  bool prm[max + 1];
  prm[0] = false;
  prm[1] = false;
  prm[2] = true;
  for (int i = 2; i < max + 1; i++) {
    prm[i] = true;
    int j = 2;
    while (j * j <= i) {
      if (prm[j]) {
        if (i % j == 0) {
          prm[i] = false;
          break;
        }
      }
      j++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (prm[x[i]]) {
      ans++;
    }
  }
  printf("%d\\n", ans);
  return 0;
}

#include <stdbool.h>
#include <stdio.h>

bool prime(int x) {
  if (x <= 1) {
    return false;
  }
  if (x == 2) {
    return true;
  }

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

int main(void) {
  int n;
  scanf("%d", &n);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (prime(x)) {
      ans++;
    }
  }
  printf("%d\\n", ans);
  return 0;
}


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

#define MAX_INPUT_SIZE 10240

using namespace std;

int main(int argc, char *argv[]) {
  char input[MAX_INPUT_SIZE];

  int lines = atoi(fgets(input, sizeof(input), stdin));
  int *array = new int[lines];
  for (int i = 0; i < lines; i++) {
    array[i] = atoi(fgets(input, sizeof(input), stdin));
  }

  sort(array, array + lines);
  int max = array[lines - 1];

  for (int i = 0; i < lines; i++) {
    if (array[i] != -1) {
      for (int j = 2; j < max; j++) {
        if (array[i] % j == 0 && array[i] != j) {
          array[i] = -1;
        }
      }
    }
  }

  int num = 0;
  for (int i = 0; i < lines; i++) {
    if (array[i] > 0) {
      num++;
    }
  }

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

  return 0;
}

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

#define MAX_INPUT_SIZE 10240

using namespace std;

int main(int argc, char *argv[]) {
  char input[MAX_INPUT_SIZE];

  int lines = atoi(fgets(input, sizeof(input), stdin));
  int *array = new int[lines];
  for (int i = 0; i < lines; i++) {
    array[i] = atoi(fgets(input, sizeof(input), stdin));
  }

  sort(array, array + lines);
  int max = array[lines - 1];
#if 0
    for (int i = 0; i < lines; i++) {
        printf("%d\\n", array[i]);
    }
#endif
  double sq = sqrt(max);

  for (int i = 0; i < lines; i++) {
    for (int j = 2; j < sq; j++) {
      if (array[i] != j && array[i] % j == 0) {
        array[i] = -1;
      }
    }
  }

  int num = 0;
  for (int i = 0; i < lines; i++) {
    if (array[i] > 0) {
      num++;
    }
  }

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

  return 0;
}


#include <algorithm>
#include <iostream>
#include <math.h>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
bool memo[100000000] = {};
int main() {
  memo[1] = 1;
  for (int i = 2; i < 100000000 / 2; i++) {
    if (memo[i] == 0) {
      for (int k = 2 * i; k < 100000000; k += i) {
        memo[k] = 1;
      }
    }
  }
  int ans = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (memo[a]) {
    } else
      ans++;
  }
  cout << ans << endl;
}

#include <algorithm>
#include <iostream>
#include <math.h>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int check(int x) {
  if (x == 2)
    return 1;
  if (x < 2 || x % 2 == 0)
    return 0;
  for (int i = 3; i <= sqrt(x); i += 2) {
    if (x % i == 0)
      return 0;
  }
  return 1;
}
int main() {
  int n;
  int ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    ans += check(a);
  }
  cout << ans << endl;
}


#include <iostream>
#define MAX 100000000

using namespace std;

bool prime[MAX];

void isPrime(void) {

  fill(prime, prime + MAX, true);
  prime[0] = prime[1] = false;

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

int main(void) {

  isPrime();
  int n, N, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> N;
    if (prime[N])
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}


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

int countPrimeNumbers(int nums[], int n);

int main(void) {
  int n, nums[10000];
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> nums[i];
  }

  int count = countPrimeNumbers(nums, n);

  cout << count << endl;

  return 0;
}

int countPrimeNumbers(int nums[], int n) {
  int count = 0;

  for (int i = 0; i < n; i++) {
    if (nums[i] == 2) {
      count++;
      continue;
    }

    int j = 0;
    for (j = 3; j <= nums[i]; j += 2) {
      if (nums[i] % j == 0)
        break;
    }
    if (j == nums[i])
      count++;
  }

  return count;
}

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

int countPrimeNumbers(int nums[], int n);

int main(void) {
  int n, nums[10000];
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> nums[i];
  }

  int count = countPrimeNumbers(nums, n);

  cout << count << endl;

  return 0;
}

int countPrimeNumbers(int nums[], int n) {
  int count = 0;

  for (int i = 0; i < n; i++) {
    int j = 2;
    for (j = 2; j * j <= nums[i]; j++) {
      if (nums[i] % j == 0)
        break;
    }
    if (j * j > nums[i])
      count++;
  }

  return count;
}


#include <iostream>
using namespace std;
unsigned int a, n;
int main() {
  int temp = 0, flag = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    for (int i = 2; i < a; i++) {
      if (a % i == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      temp++;
    flag = 0;
  }
  cout << temp << endl;
}

#include <iostream>
using namespace std;
unsigned int a, n;
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 temp = 0, flag = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (IsPrime(a) == 1)
      temp++;
  }
  cout << temp << endl;
}


#include <iostream>
#include <vector>

int main(int argc, char *argv[]) {
  int n = 0;
  std::cin >> n;
  std::vector<int> list(n);
  for (int i = 0; i < n; ++i)
    std::cin >> list[i];

  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    bool prime = true;
    for (int j = list[i] - 1; j > 1; --j) {
      if (list[i] % j == 0)
        prime = false;
    }
    if (prime)
      ++cnt;
  }

  std::cout << cnt << std::endl;

  return 0;
}

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

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

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

int main(int argc, char *argv[]) {
  int n = 0;
  std::cin >> n;
  std::vector<int> list(n);
  for (int i = 0; i < n; ++i)
    std::cin >> list[i];

  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    bool prime = true;
    prime = isPrime(list[i]);
    if (prime)
      ++cnt;
  }

  std::cout << cnt << std::endl;

  return 0;
}


#include <iostream>
using namespace std;

int main(void) {
  int datanum;
  int *databuff;
  int *primecheck;
  int maxnum;
  int primecnt;

  primecnt = 0;
  maxnum = 0;

  cin >> datanum;

  databuff = new int[datanum];

  for (int i = 0; i < datanum; i++) {
    cin >> databuff[i];
    if (databuff[i] > maxnum) {
      maxnum = databuff[i];
    }
  }

  primecheck = new int[maxnum + 1];

  for (int i = 2; i <= maxnum; i++) {
    primecheck[i] = 1;
  }

  for (int i = 2; i <= maxnum; i++) {
    if (primecheck[i] == 1) {
      for (int j = 2 * i; j <= maxnum; j++) {
        if (j % i == 0) {
          primecheck[j] = 0;
        }
      }
    }
  }

  for (int i = 0; i < datanum; i++) {
    if (primecheck[databuff[i]] == 1) {
      primecnt++;
    }
  }

  cout << primecnt << endl;

  return 0;
}

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

int main(void) {
  int datanum;
  int notprimenum;
  int data;
  int divnum;

  notprimenum = 0;

  cin >> datanum;

  for (int i = 0; i < datanum; i++) {
    cin >> data;
    if (data == 1) {
      notprimenum++;
      continue;
    } else if (data == 2) {
      continue;
    } else if (data == 3) {
      continue;
    } else {

      if (data % 2 == 0) {
        notprimenum++;
        continue;
      }

      for (divnum = 3; divnum <= (int)sqrt(data); divnum += 2) {
        if (data % divnum == 0) {
          notprimenum++;
          break;
        }
      }
    }
  }

  cout << datanum - notprimenum << endl;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define FOR(i, k, n) for (int i = (k); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define INF 114514810
#define ELEM(array) (sizeof(array) / sizeof *(array))
#define MAX_N 100000005
#define SAFE_FREE(ptr)                                                         \\
  if (ptr != NULL) {                                                           \\
    free(ptr);                                                                 \\
    ptr = NULL;                                                                \\
  }
typedef unsigned int UINT;
#define ll long long
typedef pair<int, int> P;

bool prime[MAX_N];

void solve() {
  memset(prime, true, sizeof(prime));
  prime[0] = prime[1] = false;
  FOR(i, 2, (int)sqrt(MAX_N)) {
    if (prime[i] == true) {
      for (int j = 2; j * i <= 1000000; j++) {
        if (prime[i * j] == true)
          prime[i * j] = false;
      }
    }
  }
}

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

    int ans = 0;

    solve();
    REP(i, n + 1) {
      if (prime[i] == true) {
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, k, n) for (int i = (k); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define INF 114514810
#define ELEM(array) (sizeof(array) / sizeof *(array))
#define MAX_N 100005
#define MS(m, v) memset(m, v, sizeof(m))
#define SAFE_FREE(ptr)                                                         \\
  if (ptr != NULL) {                                                           \\
    free(ptr);                                                                 \\
    ptr = NULL;                                                                \\
  }
typedef unsigned int UINT;
typedef long long ll;
typedef pair<int, int> P;

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

int main() {
  int n;
  int ans = 0;
  int x;
  cin >> n;
  REP(i, n) {
    cin >> x;
    if (x == 2)
      ans++;
    else if (solve(x))
      ans++;
  }
  cout << ans << endl;
  return 0;
}


#include <fstream>
#include <iostream>

using namespace std;

int main() {
  int n;
  while (cin >> n) {
    int input[10000] = {0};
    int max = 0;
    for (int i = 0; i < n; i++) {
      cin >> input[i];
      if (max < input[i])
        max = input[i];
    }

    bool *sosuu = new bool[60000000];
    for (int i = 0; i <= max; i++)
      sosuu[i] = 1;

    sosuu[0] = 0;
    for (int i = 2; i <= max; i++) {
      if (i % 2 != 0) {
        int now = i;
        if (sosuu[i / 2] == 1) {
          while (now <= max) {
            now += i * 2;
            sosuu[now / 2] = 0;
          }
        }
      }
    }

    int sum = 0;
    int temp = 1;
    for (int i = 0; i < n; i++) {
      if (input[i] == 2) {
        sum += temp;
        temp = 0;
      } else if (input[i] % 2 != 0) {
        sum += sosuu[input[i] / 2];
        sosuu[input[i] / 2] = 0;
      }
    }
    cout << sum << endl;
  }
}

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

using namespace std;

int main() {
  int n;
  while (cin >> n) {
    int sum = 0;
    int input[10000] = {0};
    // int max = 0;
    int now = 0;
    for (int i = 0; i < n; i++) {
      int temp;
      cin >> temp;
      int flag = 0;
      for (int j = 0; j < now; j++) {
        if (input[i] == temp) {
          flag++;
        }
      }
      if (flag == 0) {
        int flag2 = 0;
        for (int j = 2; j <= sqrt(temp); j++) {
          if (temp % j == 0) {
            flag2++;
            break;
          }
        }
        if (flag2 == 0)
          sum++;
      }
    }
    cout << sum << endl;
  }
}


#include <iostream>
using namespace std;

bool primes[100000000];

void Sieve() {
  for (int i = 2; i < 100000000; i++) {
    primes[i] = true;
  }
  primes[1] = false;

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

bool IsPrime(int x) { return primes[x]; }

int main(void) {
  Sieve();
  int n, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    if (IsPrime(p) == true) {
      c++;
    }
  }
  cout << c << 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 n, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    if (IsPrime(p) == true) {
      c++;
    }
  }
  cout << c << endl;

  return 0;
}


#include <cstdio>
using namespace std;
bool Prime(int x) {
  for (int i = 2; i < (x / 2 + 1); i++) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  scanf("%d", &n);
  int N[n];
  for (int i = 0; i < n; i++) {
    scanf(" %d", &N[i]);
  }
  int cnt;
  for (int i = 0; i < n; i++) {
    if (Prime(N[i]) == true) {
      cnt++;
    }
  }
  printf("%d\\n", cnt);
  return 0;
}

#include <cstdio>
using namespace std;
bool Prime(int x) {
  for (int i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  scanf("%d", &n);
  int N[n];
  for (int i = 0; i < n; i++) {
    scanf(" %d", &N[i]);
  }
  int cnt;
  for (int i = 0; i < n; i++) {
    if (Prime(N[i]) == true) {
      cnt++;
    }
  }
  printf("%d\\n", cnt);
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long int n, count = 0, i;
  long long int num;
  cin >> n;
  while (n--) {
    cin >> num;
    bool flag = 0;
    for (i = 2; i <= num / 2; i++) {
      if (num % i == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      count++;
  }
  cout << count << "\\n";
  return 0;
}

#include <cmath>
#include <iostream>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long int n, count = 0, i;
  long long int num;
  cin >> n;
  while (n--) {
    cin >> num;
    bool flag = 0;
    for (i = 2; i <= sqrt(num); i++) {
      if (num % i == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      count++;
  }
  cout << count << "\\n";
  return 0;
}


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

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

  int i = 3;

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

int main() {
  int ans = 0;
  int biggest_number = 0;
  vector<int> v(100000000);

  int n;
  while (cin >> n) {
    if (n > biggest_number) {

      biggest_number = n;
    }
    v[n] = 1;
  }

  for (int i = 0; i < biggest_number + 1; i++) {
    if (v[i] == 1) {
      if (isPrime(i)) {
        ans++;
      }
    }
  }

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

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

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

  int i = 3;

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

int main() {
  int ans = 0;
  int biggest_number = 0;
  vector<bool> v(100000000);

  int n;
  while (cin >> n) {
    if (n > biggest_number) {

      biggest_number = n;
    }
    v[n] = true;
  }

  for (int i = 0; i < biggest_number + 1; i++) {
    if (v[i] == true) {
      if (isPrime(i)) {
        ans++;
      }
    }
  }

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


#include <bits/stdc++.h>

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

using namespace std;

const int inf = 1e9 + 7;

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 ans = 0;
  for (int i = 0; i < n; i++) {
    int in;
    cin >> in;
    if (isPrime(in)) {
      ans++;
    }
  }
  cout << ans << endl;

  return 0;
}

#include <bits/stdc++.h>

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

using namespace std;

const int inf = 1e9 + 7;

int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int in;
    cin >> in;
    int limit = sqrt(in);
    for (int j = 2; j <= limit; j++) {
      if (in % j == 0) {
        ans++;
        break;
      }
    }
  }
  cout << n - ans << endl;

  return 0;
}


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

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

  for (int j = 0; j < n; ++j) {
    cin >> m;
    if (m == 2)
      ++count;
    else if (m < 2 || m % 2 == 0) {
      continue;
    } else {
      i = 3;
      while (i <= sqrt(m)) {
        if (m % i == 0)
          continue;
        i = i + 2;
      }
      if (i > sqrt(m)) {
        ++count;
      }
    }
  }
  cout << count << endl;
  return 0;
}

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

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

  for (int j = 0; j < n; ++j) {
    cin >> m;
    if (m == 2)
      ++count;
    else if (m < 2 || m % 2 == 0) {
      continue;
    } else {
      i = 3;
      while (i <= sqrt(m)) {
        if (m % i == 0)
          break;
        i = i + 2;
      }
      if (i > sqrt(m)) {
        ++count;
      }
    }
  }
  cout << count << endl;
  return 0;
}


#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main() {
  int n;
  vector<int> dp(100000001, false);
  dp[0] = true;
  dp[1] = true;
  for (int i = 3; i < 100000001; i += 2) {
    if (dp[i] = false) {
      for (int j = i + i; j <= 100000001; j += i) {
        dp[j] = true;
      }
    }
  }
  cin >> n;

  return 0;
}

#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
bool check(int);
int main() {
  int n, a, count;
  count = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    if (check(a))
      count++;
  }
  cout << count << endl;

  return 0;
}
bool check(int a) {
  if (a == 2)
    return true;
  if (a % 2 == 0 || a < 2)
    return false;
  int k;
  k = 3;
  while (k <= sqrt((float)a)) {
    if (a % k == 0)
      return false;
    k += 2;
  }

  return true;
}


#include <cstdlib>
#include <iostream>
// n個の数値の入力に対して,素数の数を出力する問題
using namespace std;
bool isPrime(int x);

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

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

#include <cstdlib>
#include <iostream>
// n個の数値の入力に対して,素数の数を出力する問題
using namespace std;
bool isPrime(int x);

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

// 素数判定
// 合成数xはx <= √pを満たす素因子pを持つ
bool isPrime(int 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;
}


#include <cmath>
#include <iostream>
const int SIZE = 1000005;
using namespace std;

int book[SIZE];

void initBook() {
  for (int i = 0; i < SIZE; i++) {
    book[i] = 0;
  }

  for (int i = 2; i < SIZE; i++) {
    int flag = 1;
    for (int j = 2; j <= sqrt(i); j++) {
      if (i % j == 0) {
        flag = 0;
      }
    }
    if (flag) {
      book[i] = 1;
    }
  }
}

int main() {

  initBook();

  int n, a;
  int count = 0;
  cin >> n;

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

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

int Judge(int i) {
  int flag = 1;
  for (int j = 2; j <= sqrt(i); j++) {
    if (i % j == 0) {
      flag = 0;
    }
  }
  return flag;
}

int main() {

  int n, a;
  int count = 0;
  cin >> n;

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


const int MAX_NUM = 100000001;
class Sieve {
public:
  Sieve() {
    for (auto &a : prime)
      a = true;
    prime[0] = prime[1] = false;
  }
  void erato() {
    for (int i = 2; i * i <= MAX_NUM; ++i)
      if (prime[i])
        for (int j = 2; i * j <= MAX_NUM; ++j)
          prime[i * j] = false;
  }
  bool isPrime(int x) { return prime[x]; }

private:
  bool prime[MAX_NUM];
};

#include <iostream>
using namespace std;
int main() {
  Sieve SV;
  SV.erato();
  int N;
  cin >> N;
  int a = 0;
  for (int i = 0; i < N; ++i) {
    int x;
    cin >> x;
    a += SV.isPrime(x);
  }
  cout << a << endl;
}

template <class T> bool isPrime(T n) {
  if (n == 2)
    return true;
  if (n < 2 || n % 2 == 0)
    return false;
  for (T i = 3; i * i <= n; i += 2)
    if (n % i == 0)
      return false;
  return true;
}

#include <iostream>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a = 0;
  for (int i = 0; i < N; ++i) {
    int x;
    cin >> x;
    a += isPrime(x);
  }
  cout << a << endl;
}


#include <iostream>
#include <stdio.h>

using namespace std;

int main() {

  int n;
  int p = 0;
  cin >> n;

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

    int d = 0;
    for (int j = 1; j <= q; j++) {
      if (q % j == 0)
        d++;
      if (d > 2)
        break;
    }
    if (d == 2)
      p++;
  }

  cout << p << endl;

  return 0;
}

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

using namespace std;

int solve(int m) {

  if (m == 2) {
    // printf("?´???°??§???%d\\n",m);
    return 1;
  }
  if (m < 2 || m % 2 == 0)
    return 0;
  int e = 0;
  for (int j = 3; j <= sqrt(m); j++) {
    if (m % j == 0) {
      return 0;
    }
  }

  if (e == 0) {
    // printf("?´???°??§???%d\\n", m);
    return 1;
  }
}

int main() {

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

    int j = solve(m);
    if (j == 1)
      p++;
  }

  cout << p << endl;
  return 0;
}


#include <stdio.h>

int main() {
  int n, primes = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
  NEXT_N:
    int num;
    scanf("%d", &num);
    for (int w = 2; w * w <= num; w++) {
      if (!(num % w)) {
        i++;
        goto NEXT_N;
      }
    }
    primes++;
  }
  printf("%d\\n", primes);
  return 0;
}

#include <stdio.h>

int main() {
  int n, primes = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int num;
    scanf("%d", &num);
    int w = 2;
    for (; w * w <= num; w++) {
      if (!(num % w)) {
        primes--;
        break;
      }
    }
    primes++;
  }
  printf("%d\\n", primes);
  return 0;
}


#include <iostream>

using namespace std;

bool PrimeN(int x) {

  if (x == 1) {
    return false;
  }

  for (int i = 2; i < x - 1; i++) {

    if (x == i) {
      cout << x << endl;
      return true;
    }

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

  return true;
}

int main(void) {

  int n;
  int cnt = 0;

  cin >> n;

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

    int X;
    cin >> X;

    if (PrimeN(X)) {
      cnt++;
    }
  }

  cout << cnt << endl;

  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;

bool PrimeN(int x) {

  if (x == 1) {
    return false;
  }

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

    if (x == i) {
      // cout << x << endl;
      return true;
    }

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

  // cout << x << endl;
  return true;
}

int main(void) {

  int n;
  int cnt = 0;

  cin >> n;

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

    int X;
    cin >> X;

    if (PrimeN(X)) {
      cnt++;
    }
  }

  cout << cnt << endl;

  return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <valarray>
#include <vector>

using namespace std;

void Solution() {
  const int n = 100000000;
  vector<bool> a(n, true);
  int N;
  long int b;
  int count = 0;

  cin >> N;

  for (long int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      a[i] = false;
    } else {
      a[i] = true;
    }
  }

  a[1] = false;
  a[2] = true;

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

  for (int i = 0; i < N; i++) {
    cin >> b;

    if (a[b]) {
      count++;
    }
  }

  cout << count << endl;
}

int main() {
  Solution();
  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <valarray>
#include <vector>

#define REP(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)

using namespace std;

bool Solution(int data) {
  int i;

  if (data < 2) {
    return false;
  } else if (data == 2) {
    return true;
  }

  if (data % 2 == 0) {
    return false;
  }

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

  return true;
}

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

  cin >> n;

  rep(i, n) {
    cin >> m;
    if (Solution(m)) {
      count++;
    }
  }
  cout << count << endl;
}


#include <iostream>
typedef long long ll;
bool isPrime(ll a);

int main() {
  using namespace std;
  ll A[10001];
  int n, prime = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (isPrime(A[i])) {
      prime++;
    }
  }
  cout << prime << endl;
  return 0;
}

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

#include <iostream>
typedef long long ll;
bool isPrime(ll a);

int main() {
  using namespace std;
  ll A[10001];
  int n, prime = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (isPrime(A[i])) {
      prime++;
    }
  }
  cout << prime << endl;
  return 0;
}

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


/*
URL: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C&lang=jp
?????????: Getting Started - Prime Numbers
?????°
7/5
14:08 Online Programming Lesson???????????¢????????????????????£????????????
14:12 ????????????
14:13 ?????????????????????????????????
*/
#include <cstdio>

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

int main() {
  int n;
  scanf("%d", &n);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int m;
    scanf("%d", &m);
    if (isPrime(m)) {
      ans++;
    }
  }
  printf("%d\\n", ans);
}


#include <iostream>
using namespace std;
int main() {
  int n, i, j = 0, x[100001];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x[i];
    int total = 0;
    if (x[i] % 2 == 0 && x[i] != 2)
      continue;
    for (int k = 1; k < x[i]; k++) {
      if (x[i] % k == 0)
        total++;
    }
    if (total == 1) {
      j++;
    }
  }
  cout << j << endl;
}

#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int n, i, j = 0, x[100001];
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x[i];
    int total = 0;
    if (x[i] % 2 == 0 && x[i] != 2)
      continue;
    int N = sqrt(x[i]);
    for (int k = 1; k <= N; k++) {
      if (x[i] % k == 0)
        total++;
    }
    if (total == 1) {
      j++;
    }
  }
  cout << j << endl;
}


#include <cstdio>

const int N = 10000;
int primes[N + 1];

int main(int argc, char const *argv[]) {

  for (int i = 2; i < N + 1; ++i)
    primes[i] = i;

  for (int i = 2; i < N + 1; ++i)
    if (primes[i] == i)
      for (int j = i * 2; j < N + 1; j += i)
        primes[j] = -1;

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

  while (n-- > 0) {
    int i;
    scanf("%d", &i);
    if (primes[i] == i)
      count++;
  }

  printf("%d\\n", count);
  return 0;
}

#include <cstdio>

bool is_prime(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 true;
}

int main(int argc, char const *argv[]) {
  int n, count = 0;
  scanf("%d", &n);

  while (n-- > 0) {
    int i;
    scanf("%d", &i);
    if (is_prime(i))
      count++;
  }

  printf("%d\\n", count);
  return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <string.h>
#include <string>

using namespace std;

const int MAXN = 100000000 + 1;
char isprime[MAXN];

void init() {
  memset(isprime, -1, sizeof(isprime));
  for (int i = 2; i < MAXN; i++) {
    if (isprime[i]) {
      for (long long j = ((long long)i) * i; j < MAXN; j += i) {
        isprime[j] = 0;
      }
    }
  }
}

int main() {
  int N;
  int cnt = 0;
  init();
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    int e;
    scanf("%d", &e);
    if (isprime[e]) {
      cnt++;
    }
  }
  printf("%d\\n", cnt);

  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <string.h>
#include <string>

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

int main() {
  int N;
  int cnt = 0;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    int e;
    scanf("%d", &e);
    if (isprime(e)) {
      cnt++;
    }
  }
  printf("%d\\n", cnt);

  return 0;
}


#include <iostream>

using namespace std;

int main() {
  int i, j, *k, n, c = 0, a;

  cin >> n;
  k = new int[n];
  for (i = 0; i < n; i++) {
    cin >> k[i];
  }
  for (i = 0; i < n; i++) {
    a = 0;
    for (j = 2; j <= k[i] / 2; j++) {
      if (k[i] % j == 0)
        a = 1;
      if (a == 1)
        break;
    }
    if (a == 0)
      c++;
  }
  cout << c << endl;

  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;

int isprime(int x) {
  if (x == 2)
    return 1;
  if (x < 2 || x % 2 == 0)
    return 0;

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

int main() {
  int i, *k, n, judge, c = 0;

  cin >> n;
  k = new int[n];
  for (i = 0; i < n; i++) {
    cin >> k[i];
    if ((judge = isprime(k[i])) == 1)
      c++;
  }
  cout << c << endl;
  return 0;
}


#define _USE_MATH_DEFINES
#include <cctype>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, start, n) for (int i = start; i < n; i++)
#define And &&
#define Or ||
#define Lb cout << endl
using namespace std;

int gcd(int x, int y) {
  int r;
  while (y > 0) {
    if (y > x)
      swap(x, y);
    r = x % y;
    x = y;
    y = r;
  }
  return x;
}

int main(void) {
  int n;
  cin >> n;
  int sum = 0;
  int x, hantei = true;
  rep(i, 0, n) {
    cin >> x;
    hantei = true;
    rep(j, 1, x) {
      if (gcd(x, j) != 1) {
        hantei = false;
      }
    }
    if (hantei == true)
      sum++;
  }
  cout << sum << endl;
}

#define _USE_MATH_DEFINES
#include <cctype>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, start, n) for (int i = start; i < n; i++)
#define And &&
#define Or ||
#define Lb cout << endl
using namespace std;

bool isprime(int x) {
  if (x == 2)
    return true;

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

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

int main(void) {
  int n;
  cin >> n;
  int x;
  int sum = 0;
  rep(i, 0, n) {
    cin >> x;
    if (isprime(x))
      sum++;
  }
  cout << sum << endl;
}


#include <iostream>
#include <vector>

using namespace std;

int GCB(int x, int y) {
  int z = y;
  y = x % y;
  x = z;

  if (y == 0)
    return x;

  return GCB(x, y);
}

int PrimeNumbers(vector<int> A) {
  int count = 0;
  for (int i = 0; i < A.size(); i++) {
    for (int j = 2; j < A[i] / 2 + 1; j++) {
      if (GCB(A[i], j) != 1) {
        count++;
        break;
      }
    }
  }
  return A.size() - count;
}

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

  vector<int> A;
  A.resize(n);

  for (int i = 0; i < n; i++)
    cin >> A[i];

  cout << PrimeNumbers(A) << endl;

  return 0;
}

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

using namespace std;

bool Judge(int A) {
  for (int j = 2; j <= floor(sqrt((double)A)); j++) {
    if (A % j == 0)
      return false;
  }
  return true;
}

int PrimeNumbers(vector<int> A) {
  int count = 0;
  for (int i = 0; i < A.size(); i++) {
    if (Judge(A[i]))
      count++;
  }
  return count;
}

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

  vector<int> A;
  A.resize(n);

  for (int i = 0; i < n; i++)
    cin >> A[i];

  cout << PrimeNumbers(A) << endl;

  return 0;
}


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

int main() {
  int i, j;
  int n;
  int A[10000];
  int res = 0;
  vector<int> P;
  vector<int>::iterator it;

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

  sort(A, A + n);
  P.push_back(2);
  j = 3;
  for (i = 0; i < n; i++) {
    for (; j <= A[i]; j++) {
      it = P.begin();
      while (true) {
        if (j % (*it) == 0) {
          break;
        }
        if (++it == P.end()) {
          P.push_back(j);
          break;
        }
      }
    }
    it = P.begin();
    while (true) {
      if (A[i] % (*it) == 0 && (*it) != A[i]) {
        break;
      }
      if (++it == P.end()) {
        res++;
        P.push_back(A[i]);
        j = A[i] + 1;
        break;
      }
    }
  }

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

  return 0;
}

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

int main() {
  int i, j;
  int n;
  int A[10000];
  int res = 0;
  bool prime;

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

  for (i = 0; i < n; i++) {
    prime = true;
    for (j = 2; j <= (int)sqrt(A[i]); j++) {
      if (A[i] % j == 0) {
        prime = false;
        break;
      }
    }
    if (prime)
      res++;
  }

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

  return 0;
}


#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define REP(i, n) for (LL i = 0; i < n; i++)
#define REPR(i, n) for (LL i = n; i >= 0; i--)
#define FOR(i, m, n) for (LL i = m; i < n; i++)
#define FORR(i, m, n) for (LL i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define all(x) (x).begin(), (x).end()
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> PP;
typedef pair<LL, LP> LPP;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};

// LL ???????????´????????????????????¢??????
// typedef LL int;
// max?????§????´???°???vector?????\\????????????
vector<LL> eratos(LL max) {
  vector<LL> primeVec;
  vector<bool> isprime;
  double sqrtmax = sqrt(max);
  isprime.resize(max + 1);
  isprime[0] = false;
  isprime[1] = false;
  FOR(i, 2, max + 1) { isprime[i] = true; }
  FOR(i, 2, sqrtmax) {
    if (isprime[i]) {
      for (int j = 0; i * (j + 2) < max + 1; ++j) {
        isprime[i * (j + 2)] = false;
      }
    }
  }
  REP(i, max + 1) {
    if (isprime[i])
      primeVec.pb(i);
  }
  return primeVec;
}
int main() {
  vector<LL> sosuu;
  sosuu = eratos(100000000);

  int n;
  int ans = 0;
  cin >> n;
  while (n--) {
    int x;
    cin >> x;
    auto reslut = find(all(sosuu), x);
    if (reslut != sosuu.end())
      ans++;
  }
  cout << ans << endl;
}

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define REP(i, n) for (LL i = 0; i < n; i++)
#define REPR(i, n) for (LL i = n; i >= 0; i--)
#define FOR(i, m, n) for (LL i = m; i < n; i++)
#define FORR(i, m, n) for (LL i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define all(x) (x).begin(), (x).end()
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> PP;
typedef pair<LL, LP> LPP;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};

// typedef LL int;
bool isprime(LL x) {
  if (x == 2)
    return true;
  if (x < 2 || x % 2 == 0)
    return false;
  LL i = 3;
  LL sqrtx = sqrt(x);
  while (i <= sqrtx) {
    if (x % i == 0)
      return false;
    i += 2;
  }
  return true;
}
// max?????§????´???°???vector?????\\????????????
vector<LL> eratos(LL max) {
  vector<LL> primeVec;
  vector<bool> isprime;
  double sqrtmax = sqrt(max);
  isprime.resize(max + 1);
  isprime[0] = false;
  isprime[1] = false;
  FOR(i, 2, max + 1) { isprime[i] = true; }
  FOR(i, 2, sqrtmax) {
    if (isprime[i]) {
      for (int j = 0; i * (j + 2) < max + 1; ++j) {
        isprime[i * (j + 2)] = false;
      }
    }
  }
  REP(i, max + 1) {
    if (isprime[i])
      primeVec.pb(i);
  }
  return primeVec;
}
int main() {
  int n;
  int ans = 0;
  cin >> n;
  while (n--) {
    LL x;
    cin >> x;
    if (isprime(x))
      ans++;
  }
  cout << ans << endl;
}


#include <math.h>
#include <stdio.h>
int isprime(int x) {
  int i = 3;
  if (x == 2) {
    return 1;
  } else if (x % 2 == 0) {
    return 0;
  }
  while (i <= sqrt(x)) {
    if (x % i == 0) {
      return 0;
      i += 2;
    }
  }
  return 1;
}
int main() {
  int n, x, i;
  int count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (isprime(x)) {
      count++;
    }
  }
  printf("%d\\n", count);
  return 0;
}

#include <math.h>
#include <stdio.h>
int isprime(int x) {
  int i;
  if (x == 2) {
    return 1;
  } else if (x % 2 == 0) {
    return 0;
  }
  i = 3;
  while (i <= sqrt(x)) {
    if (x % i == 0) {
      return 0;
    }
    i += 2;
  }
  return 1;
}
int main() {
  int n, x, i;
  int count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    if (isprime(x)) {
      count++;
    }
  }
  printf("%d\\n", count);
  return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> data(n);
  for (auto &a : data) {
    cin >> a;
  }
  int check = 0;
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 2; j < data[i]; j++) {
      if (data[i] % j == 0) {
        count++;
        j = data[i];
      }
    }
    if (!count)
      check++;
  }
  cout << check << endl;
  return 0;
}

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

int main() {
  int n;
  cin >> n;
  vector<int> data(n);
  for (auto &a : data) {
    cin >> a;
  }
  int check = 0;
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 2; j <= sqrt(data[i]); j++) {
      if (data[i] % j == 0) {
        count++;
        j = data[i];
      }
    }
    if (!count)
      check++;
  }
  cout << check << endl;
  return 0;
}


// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C
// Getting Started - Prime Numbers

#define SUBMIT

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <numeric>
#include <set>
#include <utility>
#include <vector>

using namespace std;
using i64 = long long;

const int MAX_N = 10000;
bool is_prime_number[MAX_N + 1];
bool checked[MAX_N + 1];

void eratos() {
  is_prime_number[0] = false, checked[0] = true;
  is_prime_number[1] = false, checked[1] = true;
  for (int i = 2; i <= MAX_N; ++i) {
    if (!checked[i]) {
      is_prime_number[i] = true;
      for (int k = 2 * i; k <= MAX_N; k += i) {
        is_prime_number[k] = false;
        checked[k] = true;
      }
    }
  }
}

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

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

  return true;
}

int n;

int main() {
  cin >> n;

  eratos();
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    if (is_prime_number[x])
      ans++;
  }
  cout << ans << endl;
  return 0;
}

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C
// Getting Started - Prime Numbers

#define SUBMIT

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <numeric>
#include <set>
#include <utility>
#include <vector>

using namespace std;
using i64 = long long;

const int MAX_N = 20;
bool is_prime_number[MAX_N + 1];
bool checked[MAX_N + 1];

// this problem constraint shows the judged value x is 2 <= x <= 10^8.
// so eratos is not worked.
void eratos() {
  is_prime_number[0] = false, checked[0] = true;
  is_prime_number[1] = false, checked[1] = true;
  for (int i = 2; i <= MAX_N; ++i) {
    if (!checked[i]) {
      is_prime_number[i] = true;
      for (int k = 2 * i; k <= MAX_N; k += i) {
        is_prime_number[k] = false;
        checked[k] = true;
      }
    }
  }
}

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

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

  return true;
}

int n;

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


#include <iostream>

using namespace std;
const int MAX = 10e8;
// 入力
int N, x;

bool prime[MAX];
int ans;
void init() {
  for (int i = 0; i < MAX; i++)
    prime[i] = true;
  prime[0] = prime[1] = false;
  for (int i = 2; i < MAX;) {
    if (prime[i]) {
      for (int j = 2 * i; j < MAX; j += i)
        prime[j] = false;
    }
    if (i == 2)
      i++;
    else
      i += 2;
  }
}

int main() {
  cin >> N;
  ans = 0;
  init();
  while (N--) {
    cin >> x;
    if (prime[x])
      ans++;
  }
  cout << ans << endl;
}

#include <iostream>

using namespace std;
const int MAX = 10e4;
// 入力
int N, x;

bool prime[MAX];
int ans;
bool flag;
void init() {
  for (int i = 0; i < MAX; i++)
    prime[i] = true;
  prime[0] = prime[1] = false;
  for (int i = 2; i < MAX;) {
    if (prime[i]) {
      for (int j = 2 * i; j < MAX; j += i)
        prime[j] = false;
    }
    if (i == 2)
      i++;
    else
      i += 2;
  }
}

int main() {
  cin >> N;
  ans = 0;
  init();
  while (N--) {
    cin >> x;
    if (x < MAX) {
      if (prime[x])
        ans++;
    } else {
      if (x % 2 != 0) {
        flag = true;
        for (int i = 3; i < MAX; i += 2) {
          if (x % i == 0) {
            flag = false;
            break;
          }
        }
        if (flag)
          ans++;
      }
    }
  }
  cout << ans << endl;
}


#include <iostream>
#include <unordered_set>

using namespace std;

inline bool IsPrimeSlow(int x) {
  for (int i = x - 1; i > 1; --i)
    if (x % i == 0)
      return false;

  return true;
}

static bool IsPrime(int x) {
  static unordered_set<int> primes = {2, 3, 5, 7, 11, 13, 17, 19};

  if (primes.find(x) != primes.end())
    return true;

  for (auto p : primes) {
    if (x % p == 0)
      return false;
  }

  if (IsPrimeSlow(x)) {
    primes.insert(x);
    return true;
  }

  return false;
}

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

  int x;
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (IsPrime(x))
      ++cnt;
  }
  cout << cnt << endl;
  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;

static bool IsPrime(int x) {
  if (1 < x && x < 4)
    return true;
  const int z = static_cast<int>(ceil(sqrt(x)));
  for (int i = 2; i <= z; ++i) {
    if (x % i == 0)
      return false;
  }
  return true;
}

int main() {
  int n;

  cin >> n;

  int cnt = 0;
  int x;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (IsPrime(x))
      ++cnt;
  }
  cout << cnt << endl;
  return 0;
}


#include <bits/stdc++.h>

int main() {

  int count = 0;
  int n, x;

  std::cin >> n;

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

    if (x == 1)
      continue;

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

  std::cout << count << std::endl;

  return 0;
}

#include <bits/stdc++.h>

int isprime(int x) {

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

  int i = 3;

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

  return 1;
}

int main() {

  int count = 0;
  int n, x;

  std::cin >> n;

  for (int i = 0; i < n; i++) {
    std::cin >> x;
    count += isprime(x);
  }

  std::cout << count << std::endl;

  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int n;
  int x;
  int check = 0;
  int cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int j = 1; j <= x; j++) {
      if (x % j == 0) {
        check++;
      }
    }
    if (check == 2) {
      cnt++;
    }
    check = 0;
  }
  cout << cnt << "\\n";
}

#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
  int n, tmp, count = 0;
  int lim;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> tmp;
    lim = sqrt(tmp);
    for (int j = 2; j <= lim; j++) {
      if (tmp % j == 0) {
        count++;
        break;
      }
    }
  }
  cout << n - count << "\\n";
}


#include <iostream>
#include <sstream>

using namespace std;

int isPrime(int n);

int main() {
  string str;
  getline(cin, str);
  int num;
  stringstream num_ss(str);
  num_ss >> num;

  int counter = 0;

  for (int i = 0; i < num; i++) {
    getline(cin, str);
    stringstream tmp_ss(str);
    int n;
    tmp_ss >> n;
    n = isPrime(n);
    if (n != -1) {
      counter++;
    }
  }
  cout << counter << endl;
  return 0;
}

int isPrime(int n) {
  int rtn = n;
  int end_num = (n / 2) + 1;

  if (n % 2 == 0) {
    if (n == 2) {
      return n;
    } else {
      return -1;
    }
  }

  for (int i = 3; i < end_num; i += 2) {
    if (n % i == 0) {
      rtn = -1;
      break;
    }
  }
  return rtn;
}

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

using namespace std;

int isPrime(int n);

int main() {
  string str;
  getline(cin, str);
  int num;
  stringstream num_ss(str);
  num_ss >> num;

  int counter = 0;

  for (int i = 0; i < num; i++) {
    getline(cin, str);
    stringstream tmp_ss(str);
    int n;
    tmp_ss >> n;
    n = isPrime(n);
    if (n != -1) {
      counter++;
    }
  }
  cout << counter << endl;
  return 0;
}

// if the param is a prime number, then return param. Else return -1.
int isPrime(int n) {
  int rtn = n;
  int end_num = (int)sqrt(n) + 1;

  if (n % 2 == 0) {
    if (n == 2) {
      return n;
    } else {
      return -1;
    }
  }

  for (int i = 3; i < end_num; i += 2) {
    if (n % i == 0) {
      rtn = -1;
      break;
    }
  }
  return rtn;
}


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

using namespace std;

int main() {
  int i, j, s, p, tmp;

  int primes[1229];
  primes[i = 0] = 2;
  for (p = 3; p < 10000; p += 2) {
    s = sqrt((double)p);
    for (j = 0; j <= i; j++) {
      tmp = primes[j];
      if (tmp > s) {
        i++;
        primes[i] = p;
        break;
      } else if (p % tmp == 0) {
        break;
      }
    }
  }

  int N;
  cin >> N;

  int n, count = 0;

  for (i = 0; i < N; i++) {
    cin >> n;
    s = sqrt((double)n);
    for (int p : primes) {
      if (p > s) {
        count++;
        break;
      } else if (n % p == 0) {
        break;
      }
    }
  }

  cout << count << endl;

  return 0;
}

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

using namespace std;

int main() {
  int i, j, s, p, tmp;

  int primes[1230];
  primes[i = 0] = 2;
  for (p = 3; p <= 10007; p += 2) {
    s = sqrt((double)p);
    for (j = 0; j <= i; j++) {
      tmp = primes[j];
      if (tmp > s) {
        i++;
        primes[i] = p;
        break;
      } else if (p % tmp == 0) {
        break;
      }
    }
  }

  int N;
  cin >> N;

  int n, count = 0;

  for (i = 0; i < N; i++) {
    cin >> n;
    s = sqrt((double)n);
    for (int p : primes) {
      if (p > s) {
        count++;
        break;
      } else if (n % p == 0) {
        break;
      }
    }
  }

  cout << count << endl;

  return 0;
}


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

int main() {
  int n;
  cin >> n;
  int A[n], count = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < n; i++) {
    int L = A[i];
    int M = sqrt(L);
    for (int x = 2; x < L; x++) {
      if (L % x == 0) {
        count--;
        break;
      }
    }
    count++;
  }
  cout << count << endl;
  return 0;
}

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

int main() {
  int n;
  cin >> n;
  int A[n], count = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  for (int i = 0; i < n; i++) {
    int L = A[i];
    int M = sqrt(L);
    for (int x = 2; x <= M; x++) {
      if (L % x == 0) {
        count--;
        break;
      }
    }
    count++;
  }
  cout << count << endl;
  return 0;
}


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

int seive(IVEC &A, int n);

int main(void) {
  IVEC primes, nums;
  int n;

  cin >> n;
  nums.resize(n);
  for (int i = 0; i < n; i++)
    cin >> nums[i];
  sort(nums.begin(), nums.end());

  int max_num = nums[nums.size() - 1];
  seive(primes, max_num);

  for (int i = 0; i < (int)primes.size(); i++)
    for (int j = 0; j < (int)nums.size(); j++)
      if ((nums[j] >= pow(primes[i], 2)) && (nums[j] % primes[i] == 0))
        nums[j] = 0;

  int count = 0;
  for (int i = 0; i < (int)nums.size(); i++)
    if (nums[i])
      count++;

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

int seive(IVEC &A, int n) {
  IVEC num(n + 1, 1);
  num[0] = 0, num[1] = 0;
  int count = 1, limit = int(sqrt(n));
  for (int i = 3; i <= n; i += 2)
    if (num[i]) {
      count++;
      if (i <= limit)
        for (int j = 3 * i; j <= n; j += 2 * i)
          num[j] = 0;
    }

  A.resize(count);
  A[0] = 2;
  int j = 1;
  for (int i = 3; i <= n; i += 2)
    if (num[i] == 1)
      A[j++] = i;
  return 0;
}

#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef vector<int> IVEC;

int seive(IVEC &A, int n) {
  IVEC num(n + 1, 1);
  num[0] = 0;
  num[1] = 0;
  int count = 1, limit = int(sqrt(n));
  for (int i = 3; i <= n; i += 2)
    if (num[i]) {
      count++;
      if (i <= limit)
        for (int j = 3 * i; j <= n; j += 2 * i)
          num[j] = 0;
    }

  A.resize(count);
  A[0] = 2;
  int j = 1;
  for (int i = 3; i <= n; i += 2)
    if (num[i] == 1)
      A[j++] = i;
  return 0;
}

int main(void) {
  IVEC primes;
  int max_num = 10000;
  seive(primes, max_num);

  int n, n0, lim, count;
  cin >> n;
  count = n;
  for (int i = 0; i < n; i++) {
    cin >> n0;
    lim = int(sqrt(n0));
    for (int j = 0; j < (int)primes.size(); j++) {
      int tmp = primes[j];
      if (tmp * tmp > n0)
        break;
      if (n0 % tmp == 0) {
        count--;
        break;
      }
    }
  }
  cout << count << endl;
  return 0;
}


#include <iostream>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    bool flg = true;
    for (int j = 2; j < (a / 2) + 1; j++) {
      if (a % j == 0) {
        flg = false;
        break;
      }
    }
    if (flg == true) {
      t++;
    }
  }
  cout << t << endl;
}

#include <cmath>
#include <iostream>
using namespace std;
bool checkNotOdd(int n) {
  if (n % 2 == 0) {
    return false;
  } else {
    return true;
  }
}
bool check(int n) {
  for (int i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}

int main() {
  int n;
  cin >> n;
  int t = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    bool flg = true;
    flg = checkNotOdd(a);
    if (flg) {
      flg = check(a);
    }
    if (flg || a == 2) {
      t++;
    }
  }
  cout << t << endl;
}


#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
  int x, y, n, b = 0, o;
  cin >> n;
  for (o = 0; o < n; o++) {
    cin >> x;
    for (y = 2; y < x; y++) {
      if (x % y == 0) {
        goto loop;
      }
    }
    b++;
  loop:;
  }
  cout << b << endl;
}

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
  int x, y, n, b = 0, o;
  cin >> n;
  for (o = 0; o < n; o++) {
    cin >> x;
    for (y = 2; y * y <= x; y++) {
      if (x % y == 0) {
        goto loop;
      }
    }
    b++;
  loop:;
  }
  cout << b << endl;
}


#include <iostream>
using namespace std;

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

  int sum = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 2)
      sum++;
    else {
      for (int j = 2; j < a[i]; j++) {
        if (a[i] % j == 0)
          break;
        if (j == a[i] - 1)
          sum++;
      }
    }
  }
  cout << sum << endl;
  return 0;
}

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

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

  int sum = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 2)
      sum++;
    else {
      int k = ceil(sqrt(a[i]));
      for (int j = 2; j <= k; j++) {
        if (a[i] % j == 0)
          break;
        if (j == k)
          sum++;
      }
    }
  }
  cout << sum << endl;
  return 0;
}


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

using namespace std;

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

int main() {
  int len;
  cin >> len;
  vector<int> src(len);

  for (int &a : src)
    cin >> a;

  int primeNumCount = 0;
  for (int a : src) {
    if (IsPrime(a))
      primeNumCount++;
  }

  cout << primeNumCount << endl;

  return 0;
}

#include <array>
#include <cmath>
#include <iostream>

using namespace std;

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

int main() {
  int len;
  cin >> len;
  array<int, 10000> src;

  for (int i = 0; i < len; i++) {
    cin >> src[i];
  }

  int primeNumCount = 0;
  for (int i = 0; i < len; i++) {
    if (IsPrime(src[i]))
      primeNumCount++;
  }

  cout << primeNumCount << endl;

  return 0;
}


#include <iostream>
using namespace std;

bool is_prime(long x) {
  long d = x - 1;
  while (d > 1 && (x % d) != 0) {
    d--;
  }
  return (d == 1);
}

int main(int argc, char **argv) {
  int N;
  cin >> N;

  long x;
  int count = 0;
  for (int i = 0; i < N; i++) {
    cin >> x;
    if (is_prime(x))
      count++;
  }
  cout << count << endl;
}

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

bool is_prime(long x) {
  long d = ceil(sqrt(x));
  if (x == d)
    d--;
  while (d > 1 && (x % d) != 0) {
    d--;
  }
  return (d == 1);
}

int main(int argc, char **argv) {
  int N;
  cin >> N;

  long x;
  int count = 0;
  for (int i = 0; i < N; i++) {
    cin >> x;
    if (is_prime(x))
      count++;
  }
  cout << count << endl;
}


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

using namespace std;

bool Sieve(int x) {
  for (int i = 2; i <= sqrt(x); i++)
    if (x % i == 0)
      return false;
  return true;
}
int main() {
  int n;
  vector<int> items;
  // input
  cin >> n;
  items.resize(n);
  for (int i = 0; i < n; i++)
    cin >> items[i];

  // process
  int count = 0;
  for (int y : items)
    if (Sieve(y))
      count++;
  cout << count << endl;
  return 0;
}

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

using namespace std;

bool Sieve(int x) {
  for (int i = 2; i <= sqrt(x); i++)
    if (x % i == 0)
      return false;
  return true;
}
int main() {
  int n;
  vector<int> items;
  // input
  cin >> n;
  items.resize(n);
  for (int i = 0; i < n; i++)
    cin >> items[i];

  // process
  int count = 0;
  for (int i = 0; i < n; i++)
    if (Sieve(items[i]))
      count++;
  cout << count << endl;
  return 0;
}


#include <iostream>
using namespace std;

bool sosu(int n) {
  if (n == 2)
    return true;
  else if (n % 2 == 0)
    return false;

  int kisu = 3;
  while (1) {
    if (kisu >= n)
      break;
    if (n % kisu == 0)
      return false;
    kisu += 2;
  }
  return true;
}

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

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

bool sosu(int n) {
  if (n < 2)
    return false; // 2以下除く
  else if (n == 2)
    return true; // 2は素数
  else if (n % 2 == 0)
    return false; // 偶数除く
  int root = sqrt(n);
  for (int i = 3; i <= root; i += 2) { // 奇数で割る
    if (n % i == 0)
      return false;
  }
  return true;
}

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


#include <iostream>
using namespace std;

#define lim 100000001

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

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

  bool *is_prime = new bool[lim];

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

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

  for (int i = 0; i < n; i++) {
    if (is_prime[s[i]]) {
      cnt++;
    }
  }

  cout << cnt << "\\n";

  return 0;
}

#include <iostream>
using namespace std;

bool is_prime(const unsigned n) {
  switch (n) {
  case 0:
    return false;
  case 1:
    return false;
  case 2:
    return true;
  }

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

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

  return true;
}

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

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

  cout << cnt << "\\n";

  return 0;
}


#include <math.h>
#include <stdio.h>
#define MAX 10000000

int main() {
  int i, j, n, s, ary[10000], y;
  double x;

  scanf("%d", &n);
  s = n;
  for (i = 0; i < n; i++) {
    scanf("%d", &ary[i]);
  }
  for (i = 0; i < n; i++) {
    for (j = 2; j <= sqrt(ary[i]); j++) {
      if (ary[i] % j == 0) {
        s = s - 1;
        break;
      }
    }
  }
  printf("%d\\n", s);
}


#include <iostream>
#include <math.h>
using namespace std;
int gcd(int a1, int b1) {
  if (a1 == 0 || b1 == 0) {
    return 0;
  }
  if (a1 >= b1) {
    if (a1 % b1 == 0) {
      return b1;
    } else {
      return gcd(b1, a1 % b1);
    }
  } else {
    if (b1 % a1 == 0) {
      return a1;
    } else {
      return gcd(a1, b1 % a1);
    }
  }
}

int main(void) {
  // Here your code !
  int n, k, p = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    k = 0;
    cin >> a[i];
    if (a[i] == 2) {
      p++;
      continue;
    } else if (a[i] % 2 == 0) {
      continue;
    }
    for (int j = 0; j < floor(sqrt(a[i])); j++) {
      if (gcd(a[i], j + 1) == j + 1) {
        k++;
      }
    }
    if (k == 1) {
      p++;
    }
  }
  cout << p << endl;
}

#include <iostream>
#include <math.h>
using namespace std;
int gcd(int a1, int b1) {
  if (a1 == 0 || b1 == 0) {
    return 0;
  }
  if (a1 >= b1) {
    if (a1 % b1 == 0) {
      return b1;
    } else {
      return gcd(b1, a1 % b1);
    }
  } else {
    if (b1 % a1 == 0) {
      return a1;
    } else {
      return gcd(a1, b1 % a1);
    }
  }
}

int main(void) {
  // Here your code !
  int n, k, p = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    k = 0;
    cin >> a[i];
    if (a[i] == 2) {
      p++;
      continue;
    } else if (a[i] % 2 == 0) {
      continue;
    }
    for (int j = 0; j < floor(sqrt(a[i])); j++) {
      if (a[i] % (j + 1) == 0) {
        k++;
      }
    }
    if (k == 1) {
      p++;
    }
  }
  cout << p << endl;
}


#include <cassert>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int primes[10000];

int to_i(const string &num) {
  int res = 0;
  for (int i = 0; i < num.size(); ++i) {
    res = res * 10 + (num[i] - '0');
  }
  return res;
}

int main(void) {

  int N;
  cin >> N;

  int total = 0;
  for (int i = 0; i < N; ++i) {
    string num;
    cin >> num;
    bool ok = true;
    for (int j = 2, n = to_i(num); j < n; ++j) {
      if (to_i(num) % j == 0) {
        ok = false;
        break;
      }
    }
    if (ok)
      ++total;
  }

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

  return 0;
}

#include <cassert>
#include <cctype>
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

bool IsPrime(int num) {
  if (num < 2)
    return false; // 2未満は素数
  if (num == 2)
    return true; // 2は素数
  if (num % 2 == 0)
    return false; // 2で割り切れれば素数ではない

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

// 時間切れ
int main(void) {

  int N;
  cin >> N;

  int total = 0;
  for (int i = 0; i < N; ++i) {
    int e;
    cin >> e;
    if (IsPrime(e))
      ++total;
  }

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

  return 0;
}


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

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C

int main() {
  int n;
  cin >> n;
  int arr[n];
  int max = 0;
  vector<int> primes;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] > max)
      max = arr[i];
  }

  for (int i = 2; i <= max; i++) {
    bool prime = true;
    for (int j = 0; j < primes.size(); j++) {
      if (i % primes[j] == 0) {
        prime = false;
        break;
      }
    }

    if (!prime)
      continue;
    primes.push_back(i);
  }

  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < primes.size(); j++) {
      if (arr[i] == primes[j]) {
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

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

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C

bool is_prime(int x) {
  if (x == 2)
    return true;
  if (x < 2 || x % 2 == 0)
    return false;
  int sq = sqrt(x);
  for (int i = 3; i <= sq; i += 2) {
    if (x % i == 0)
      return false;
  }
  return true;
}

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


#include <cmath>
#include <cstdio>
#include <iostream>

using namespace std;

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

int main() {

  int n;
  scanf("%d", &n);
  int x[n];
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x[i]);
  }

  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (isPrime(x[i])) {
      ++cnt;
    }
  }
  cout << cnt << endl;

  return 0;
}

#include <cmath>
#include <cstdio>
#include <iostream>

using namespace std;

bool isPrime(int x) {
  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;
  }
  return true;
}

int main() {

  int n;
  scanf("%d", &n);
  int x[n];
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x[i]);
  }

  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (isPrime(x[i])) {
      ++cnt;
    }
  }
  cout << cnt << endl;

  return 0;
}


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

using namespace std;
bool IsPrime(int a) {
  if (a == 2)
    return true;
  if (a % 2 == 0) {
    return false;
  }
  for (int i = 3; i < a; i += 2) {
    if (a % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int a = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (IsPrime(a))
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}

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

using namespace std;
bool IsPrime(int a) {
  if (a == 2)
    return true;
  if (a % 2 == 0) {
    return false;
  }
  for (int i = 3; i <= sqrt(a); i += 2) {
    if (a % i == 0) {
      return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int a = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (IsPrime(a))
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}


#include <iostream>
using namespace std;

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

int main() {

  int n;
  cin >> n;

  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int j;
    cin >> j;
    if (prime(j))
      ++ans;
  }
  cout << ans << endl;

  return 0;
}

#include <iostream>
using namespace std;

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

int main() {

  int n;
  cin >> n;

  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int j;
    cin >> j;
    if (prime(j))
      ++ans;
  }
  cout << ans << endl;

  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int prime[10000], k = 1, j = 1, n, N[10000], count = 0;
  prime[1] = 2;
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> N[i];
  for (int N = 2; N < 1000000; N++) {
    while (j <= k) {
      if (N % prime[j] == 0)
        goto No;
      else
        j++;
    }
    prime[j] = N;
    k = j;
  No:
    j = 1;
  }
  for (int i = 1; i < k + 1; i++)
    cout << prime[i] << " ";
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= 1000000; j++) {
      if (N[i] == prime[j])
        count++;
    }
  }
  cout << count << endl;
  return 0;
}

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

int prime(int x) {
  int i = 3;
  if (x == 2)
    return 1;
  else if (x < 2 || x % 2 == 0)
    return 0;
  for (i; i <= sqrt(x); i += 2)
    if (x % i == 0)
      return 0;

  return 1;
}

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