#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

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

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

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

    //        cout << a[i] << " : ";

    int numOfDivisor = 0;

    if (a[i] == 1 ||
        (a[i] != 2 &&
         a[i] % 2 == 0)) { // 1????????????2??\\????????¶??°?????????
      //            cout << "even\\n";
      continue;
    }

    for (int j = 3; j < a[i] / 2; j += 2) {
      if (a[i] % j == 0) {
        numOfDivisor++;
        //                cout << j << " ";
      }
    }

    if (numOfDivisor == 0) {
      cnt++;

      //            cout << "***";
    }

    //        cout << endl;
  }

  cout << cnt << endl;

  return 0;
}

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

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

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

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

    //        cout << a[i] << " : ";

    int numOfDivisor = 0;

    if (a[i] == 1 ||
        (a[i] != 2 &&
         a[i] % 2 == 0)) { // 1????????????2??\\????????¶??°?????????
      //            cout << "even\\n";
      continue;
    }

    for (int j = 3; j <= sqrt(a[i]); j += 2) {
      if (a[i] % j == 0) {
        numOfDivisor++;
        //                cout << j << " ";
      }
    }

    if (numOfDivisor == 0) {
      cnt++;

      //            cout << "***";
    }

    //        cout << endl;
  }

  cout << cnt << endl;

  return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int n, i, x, j, flag = 0, cut = 0, a;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    a = sqrt(x);
    flag = 0;
    for (j = x - 1; j > 1; j--) {
      if (x % j == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      cut++;
  }
  cout << cut << endl;
  return 0;
}

#include <iostream>
#include <math.h>
using namespace std;
int main() {
  int n, i, x, j, flag = 0, cut = 0, a;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    a = sqrt(x);
    flag = 0;
    for (j = a; j > 1; j--) {
      if (x % j == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      cut++;
  }
  cout << cut << endl;
  return 0;
}


#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

int main() {

  int n;
  cin >> n;

  int *in = new int[n];

  int maxi = -1;
  for (int i = 0; i < n; i++) {
    cin >> in[i];
    if (maxi == -1 || maxi < in[i])
      maxi = in[i];
  }

  maxi = maxi + 1;
  bool *x = new bool[maxi];
  for (int i = 0; i < maxi; i++) {
    x[i] = true;
  }

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

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

#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

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

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

  // 素数である
  return true;
}

int main() {

  int n;
  cin >> n;

  int *in = new int[n];

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

  cout << count << endl;
}


// IN THE NAME OF GOD

#include <iostream>
using namespace std;
typedef long long int ll;
bool b[100000009];
int a, n, ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 2; i <= 10000; i++) {
    if (!b[i]) {
      for (int j = i * i; j <= 100000000; j += i)
        b[j] = 1;
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (!b[a]) {
      ans++;
      b[a] = 1;
    }
  }
  cout << ans << endl;
  return 0;
}

// IN THE NAME OF GOD

#include <iostream>
using namespace std;
typedef long long int ll;
int a, n, ans, d;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    for (int j = 2; j * j <= a; j++) {
      if (!(a % j)) {
        a = -1;
        break;
      }
    }
    if (a != -1)
      ans++;
  }
  cout << ans << endl;
  return 0;
}


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

bool prime[100000000];

void build_table();

void check();

int main() {
  build_table();
  // check();

  int n;
  cin >> n;
  int cnt = 0;
  int in;
  for (int i = 0; i < n; i++) {
    cin >> in;
    if (prime[in] == true)
      cnt++;
  }
  cout << cnt << endl;
}

void build_table() {

  for (int i = 0; i < 100000000; i++)
    prime[i] = true;

  int sqrt_num = sqrt(100000000);
  prime[0] = prime[1] = false;
  for (int i = 2; i <= sqrt_num; i++) {
    if (prime[i]) {
      for (int k = (100000000 - 1) / i, j = k * i; k >= i; k--, j -= i) {
        if (prime[k])
          prime[j] = false;
      }
    }
  }
}

void check() {
  for (int i = 0; i < 100; i++)
    if (prime[i])
      cout << i << endl;
}

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

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

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


#include <iostream>
using namespace std;
bool heheda(int a);

bool heheda(int a) {
  for (int i = 2; i * 2 <= a; i++)
    if (!(a % i))
      return false;
  return true;
}

int main() {
  int n;
  cin >> n;
  int tmp2 = 0;
  int c;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (heheda(c))
      tmp2 += 1;
  }
  cout << tmp2 << endl;
  return 0;
}

#include <iostream>
using namespace std;
bool heheda(int a);

bool heheda(int a) {
  for (int i = 2; i * i <= a; i++)
    if (!(a % i))
      return false;
  return true;
}

int main() {
  int n;
  cin >> n;
  int tmp2 = 0;
  int c;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (heheda(c))
      tmp2 += 1;
  }
  cout << tmp2 << endl;
  return 0;
}


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

int main() {
  int n, m;
  ;
  cin >> m;
  int count = m;
  for (int s = 0; s < m; s++) {
    cin >> n;
    if (n == 2)
      continue;
    else if (n % 2 == 0)
      count--;
    else {
      for (int i = 3; i < n; i += 2) {
        if (n % i == 0) {
          count--;
          break;
        }
      }
    }
  }
  cout << count << endl;

  return 0;
}

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

int main() {
  int n, m;
  ;
  cin >> m;
  int count = m;
  for (int s = 0; s < m; s++) {
    cin >> n;
    if (n == 2)
      continue;
    else if (n % 2 == 0)
      count--;
    else {
      for (int i = 3; i <= sqrt(n); i += 2) {
        if (n % i == 0) {
          count--;
          break;
        }
      }
    }
  }
  cout << count << endl;

  return 0;
}


#include <iostream>
#include <set>
#include <vector>

using namespace std;

vector<unsigned long> prime(int d) {
  int n = d / 32 + 1;
  vector<unsigned long> arr(n, -1);

  for (int i = 2; i <= d; i++) {
    int indx = i / 32;
    int offset = (i % 32) - 1;
    if (((arr[indx] >> offset) & 1) == 0)
      continue;

    for (int j = 2; j * i <= d; j++) {
      int indx = j * i / 32;
      int offset = (j * i % 32) - 1;
      if (((arr[indx] >> offset) & 1) == 0)
        continue;
      arr[indx] ^= (1 << offset);
    }
  }
  return arr;
}

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

  int m = 0;
  vector<int> in;
  for (int i = 0; i < N; i++) {
    int d;
    cin >> d;
    in.push_back(d);
    m = max(m, d);
  }

  vector<unsigned long> arr = prime(m);
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int indx = in[i] / 32;
    int offset = (in[i] % 32) - 1;
    if (((arr[indx] >> offset) & 1) == 0)
      continue;
    ans++;
  }
  cout << ans << endl;
  return 0;
}

#include <iostream>
#include <set>
#include <vector>

using namespace std;

vector<bool> prime(int d) {
  vector<bool> arr(d + 1, true);
  arr[0] = arr[1] = false;

  for (int i = 2; i * i <= d; i++) {
    if (!arr[i])
      continue;
    for (int j = 2; j * i <= d; j++) {
      if (!arr[j * i])
        continue;
      arr[j * i] = false;
    }
  }

  return arr;
}

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

  int m = 0;
  vector<int> input;
  for (int i = 0; i < N; i++) {
    int d;
    cin >> d;
    input.push_back(d);
    m = max(m, d);
  }

  vector<bool> arr = prime(m);

  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (arr[input[i]])
      ans++;
  }
  cout << ans << endl;
  return 0;
}


#include <iostream>
#include <vector>
#define N 100000000

using namespace std;

bool sieve[N + 1];

int main() {

  // initialize sieve of Eratosthenes
  for (int i = 2; i <= N; ++i) { // from smallest prime 2
    sieve[i] = true;             // set all to true
  }

  for (int i = 2; i <= N; i++) {
    if (sieve[i]) {
      for (int j = 2 * i; j <= N; j += i) {
        sieve[j] = false; // sieve multiples of primes
      }
    }
  }

  int n; // number of inputs

  cin >> n;

  int prime_count = 0;

  for (int i = 0; i < n; ++i) {
    int input;
    cin >> input;
    if (sieve[input] == true)
      ++prime_count;
  }

  cout << prime_count << endl;
}

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

using namespace std;

bool isPrime(int a) {
  int squared = sqrt(a);
  for (int i = 2; i <= squared; ++i) { // only need to test up to squareroot
    if (a % i == 0) {
      return false;
    }
  }
  return true;
}

int main() {

  int n; // number of inputs

  cin >> n;

  int prime_count = 0;

  for (int i = 0; i < n; ++i) {
    int input;
    cin >> input;
    if (isPrime(input))
      ++prime_count;
  }

  cout << prime_count << endl;
}


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

int main() {
  int n;
  int in;
  int num_prime = 0;
  bool isPrime = true;

  scanf("%d", &n);
  if (n < 1 || n > 10000) {
    printf("Error: n is out of range");
    return -1;
  }

  for (int i = 0; i < n; i++) {
    scanf("%d", &in);
    if (in < 2 || in > 10e8) {
      printf("Error: the input is out of range");
      return -1;
    }

    // check if is prime
    if (in == 2 || in == 3) {
      isPrime = true;
    } else if (in % 2 == 0) {
      isPrime = false;
    } else if (in % 2 != 0) {
      for (int i = 3; i < in - 1; i += 2) {
        if (in % i == 0) {
          isPrime = false;
          break;
        }
      }
    }

    if (isPrime == false) {
      isPrime = true;
      continue;
    } else if (isPrime == true) {
      num_prime += 1;
      /* printf("is prime\\n"); */
    }
  }

  printf("%d\\n", num_prime);
}

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

int main() {
  int n;
  int in;
  int half_in;
  int num_prime = 0;
  bool isPrime = true;

  scanf("%d", &n);
  if (n < 1 || n > 10000) {
    printf("Error: n is out of range");
    return -1;
  }

  for (int i = 0; i < n; i++) {
    scanf("%d", &in);
    if (in < 2 || in > 10e8) {
      printf("Error: the input is out of range");
      return -1;
    }

    // check if is prime
    if (in == 2 || in == 3) {
      isPrime = true;
    } else if (in % 2 == 0) {
      isPrime = false;
    } else if (in % 2 != 0) {
      for (int i = 3; i <= sqrt(in); i += 2) {
        if (in % i == 0) {
          isPrime = false;
          break;
        }
      }
    }

    if (isPrime == false) {
      isPrime = true;
      continue;
    } else if (isPrime == true) {
      num_prime += 1;
      /* printf("is prime\\n"); */
    }
  }

  printf("%d\\n", num_prime);
}


#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <string>
#define _USE_MATH_DEFINES

using namespace std;

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

int main() {

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

  cout << cnt << endl;

  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <string>
#define _USE_MATH_DEFINES

using namespace std;

bool isPrime(int n) {

  int i = 3;

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

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

int main() {

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

  cout << cnt << endl;

  return 0;
}


#include <cstdio>
#include <cstring>

typedef long long int lli;

char prime[50000012];

int main(void) {
  //    memset(prime, 0xFF, sizeof(prime));
  prime[0] = 1;
  for (lli i = 3; i < 100000020; i += 2)
    if (!prime[i / 2])
      for (lli j = 3; i * j < 100000020; j += 2)
        prime[i * j / 2] = 1;

  int n;
  scanf("%d", &n);
  int res = 0;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    if (!(a % 2) && a - 2)
      continue;
    if (!prime[a / 2])
      res++;
  }
  printf("%d\\n", res);
  return 0;
}

#include <cstdio>
#include <cstring>

typedef long long int lli;

char prime[50000002];

int main(void) {
  //    memset(prime, 0xFF, sizeof(prime));
  prime[0] = 1;
  for (lli i = 3; i < 100000002; i += 2)
    if (!prime[i / 2])
      for (lli j = 3; i * j < 100000002; j += 2)
        prime[i * j / 2] = 1;

  int n;
  scanf("%d", &n);
  int res = 0;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    if (!(a % 2) && a - 2)
      continue;
    if (!prime[a / 2])
      res++;
  }
  printf("%d\\n", res);
  return 0;
}


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

bool notPrime[100000005] = {};

void calcPrimes(int n) {
  int sqrtn = static_cast<int>(sqrt(n));
  notPrime[1] = true;
  for (int i = 2; i <= sqrtn; ++i) {
    if (notPrime[i])
      continue;
    for (int j = i * i; j <= n; j += i)
      notPrime[j] = true;
  }
}

int main() {
  int N = 0;
  cin >> N;
  vector<int> nums(N);
  for (auto &num : nums)
    cin >> num;
  int numMax = 0;
  numMax = *max_element(nums.begin(), nums.end());
  calcPrimes(numMax);
  int counter = 0;
  for (auto &num : nums) {
    if (!notPrime[num])
      ++counter;
  }
  cout << counter << endl;
  return 0;
}

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

bool notPrime[50000005] = {};

void calcPrimes(int n) {
  int sqrtn = static_cast<int>(sqrt(n));
  notPrime[0] = true;
  for (int i = 3; i <= sqrtn; i += 2) {
    if (notPrime[i / 2])
      continue;
    for (int j = i * i; j <= n; j += 2 * i)
      notPrime[j / 2] = true;
  }
}

int main() {
  int N = 0;
  cin >> N;
  vector<int> nums(N);
  for (auto &num : nums)
    cin >> num;
  int numMax = 0;
  numMax = *max_element(nums.begin(), nums.end());
  calcPrimes(numMax);
  int counter = 0;
  for (auto &num : nums) {
    if (num == 2 || ((num & 1) && !notPrime[num / 2]))
      ++counter;
  }
  cout << counter << endl;
  return 0;
}


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

// void get(vector<int> &prime1, int max){
//	bool prime2[max+1];
//	prime2[1] = prime2[0] = false;
//	for(int a = 2; a<=max; a++){
//		prime2[a] = true;
//	}
//	if(max>=4){
//		for(int i=2; i<=sqrt((double)max); i++){
//			if(prime2[i]) {
//			for(int j=i; i*j<=max ;j++)
//			{
//				for(int k = j*i; k<=max; k*=i)
//				prime2[k] = false;
//			}
//
//			}
//		}
//	}
//	for(int x = 0; x<=max; x++){
//		if(prime2[x])
//		prime1.push_back(x);
//	}
// }

bool IsPrime(int max) {
  bool prime2[max + 1];
  prime2[1] = prime2[0] = false;
  for (int a = 2; a <= max; a++) {
    prime2[a] = true;
  }
  if (max >= 4) {
    for (int i = 2; i <= sqrt((double)max); i++) {
      if (prime2[i]) {
        for (int j = i; i * j <= max; j++) {
          for (int k = j * i; k <= max; k *= i)
            prime2[k] = false;
        }
      }
    }
  }
  return prime2[max];
}

int main() {
  int n;
  cin >> n;
  int count = 0;
  int max = 0;
  int array[n];
  vector<int> prime1;
  for (int i = 0; i < n; i++) {
    cin >> array[i];
    //		if(array[i]>max)
    //		max = array[i];
    if (IsPrime(array[i]))
      count++;
  }

  //	get(prime1, max);

  //	for(int i = 0; i<n; i++){
  //		for(int j = 0; j<prime1.size(); j++){
  //			if(array[i] == prime1[j])
  //			count++;
  //		}
  //	}
  cout << count << endl;
  return 0;
}

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

// void get(vector<int> &prime1, int max){
//	bool prime2[max+1];
//	prime2[1] = prime2[0] = false;
//	for(int a = 2; a<=max; a++){
//		prime2[a] = true;
//	}
//	if(max>=4){
//		for(int i=2; i<=sqrt((double)max); i++){
//			if(prime2[i]) {
//			for(int j=i; i*j<=max ;j++)
//			{
//				for(int k = j*i; k<=max; k*=i)
//				prime2[k] = false;
//			}
//
//			}
//		}
//	}
//	for(int x = 0; x<=max; x++){
//		if(prime2[x])
//		prime1.push_back(x);
//	}
// }

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

int main() {
  int n;
  cin >> n;
  int count = 0;
  int max = 0;
  int array[n];
  vector<int> prime1;
  for (int i = 0; i < n; i++) {
    cin >> array[i];
    //		if(array[i]>max)
    //		max = array[i];
    if (IsPrime(array[i]))
      count++;
  }

  //	get(prime1, max);

  //	for(int i = 0; i<n; i++){
  //		for(int j = 0; j<prime1.size(); j++){
  //			if(array[i] == prime1[j])
  //			count++;
  //		}
  //	}
  cout << count << endl;
  return 0;
}


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

bool isPrime(int x) {
  if (x == 1 || (x > 2 && x % 2 == 0)) {
    return false;
  }
  int i = 3;
  while (i < x) {
    if (x % i == 0) {
      return false;
    }
    i += 2;
  }
  return true;
}
int main() {
  int n, i, x, cnt = 0;
  vector<int> v;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  vector<int>::iterator ite = v.begin();
  while (ite != v.end()) {
    if (isPrime(*ite)) {
      /*if(cnt++ != 0){
          cout << " ";
      }
      cout << *ite;
      */
      cnt++;
    }
    ite++;
  }
  cout << cnt << endl;
  return 0;
}

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

int squrtInt(int x) {
  if (x < 4) {
    return 1;
  } else {
    int i = 2;
    while (i < x) {
      if (i * i > x) {
        return i - 1;
      }
      i++;
    }
  }
  return 1;
}
bool isPrime(int x) {
  if (x == 1 || (x > 2 && x % 2 == 0)) {
    return false;
  }
  int i = 3, max = squrtInt(x) + 1;
  // cout << x << ", " << max << endl;
  while (i < max) {
    if (x % i == 0) {
      return false;
    }
    i += 2;
  }
  return true;
}
int main() {
  int n, i, x, cnt = 0;
  vector<int> v;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  vector<int>::iterator ite = v.begin();
  while (ite != v.end()) {
    if (isPrime(*ite)) {
      /*if(cnt++ != 0){
          cout << " ";
      }
      cout << *ite;
      */
      cnt++;
    }
    ite++;
  }
  cout << cnt << endl;
  return 0;
}


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

int s[100000] = {};

bool judge(int n) {
  bool j = true;
  for (int i = 0; s[i] * s[i] <= n; i++) {
    if (s[i] == 0) {
      return j;
    }
    if (n % s[i] == 0) {
      return j = false;
    }
  }
  return j;
}

int main() {

  s[0] = 2;
  int c = 1;
  for (int i = 3; i < 100000; i += 2) {
    if (judge(i)) {
      s[c] = i;
      c++;
    }
  }

  int count = 0;
  int n, a[5000] = {};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (judge(a[i])) {
      count++;
    }
  }

  cout << count << endl;

  return 0;
}

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

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

int main() {
  int n, a;
  cin >> n;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (judge(a)) {
      count++;
    }
  }

  cout << count << endl;

  return 0;
}


#include <iostream>

using namespace std;

int main() {
  int a, d = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    int b;
    cin >> b;
    d++;
    for (int j = 2; j < b / 2 + 1; j++) {
      if (b % j == 0) {
        d--;
        break;
      }
    }
  }
  cout << d << endl;
}

#include <iostream>

using namespace std;

int main() {
  int a, d = 0;
  cin >> a;
  for (int i = 0; i < a; i++) {
    int b;
    cin >> b;
    d++;
    for (int j = 2; j * j <= b; j++) {
      if (b % j == 0) {
        d--;
        break;
      }
    }
  }
  cout << d << endl;
}


#include <iostream>
using namespace std;
int main() {
  bool sosu[10001];
  for (int i = 2; i <= 10000; i++) {
    sosu[i] = true;
  }
  for (int i = 2; i <= 10000; i++) {
    if (sosu[i] == true) {
      for (int ii = i * 2; ii <= 10000; ii += i) {
        sosu[ii] = false;
      }
    }
  }
  int time, ansa = 0;
  cin >> time;
  int suuti;
  for (int i = 0; i < time; i++) {
    cin >> suuti;
    if (sosu[suuti] == true) {
      ansa++;
    }
  }
  cout << ansa << endl;
  return 0;
}

#include <cmath>
#include <iostream>
using namespace std;
int main() {
  int time, atai, ansa = 0;
  cin >> time;
  long suuti;
  ansa = time;
  for (int i = 0; i < time; i++) {
    cin >> suuti;
    if (suuti == 2) {
      continue;
    }
    atai = sqrt(suuti);
    for (int ii = 2; ii <= atai + 1; ii++) {
      if (suuti % ii == 0) {
        --ansa;
        break;
      }
    }
  }
  cout << ansa << endl;
  return 0;
}


#include <iostream>
#include <vector>
using namespace std;
int main() {
  vector<int> sosu;
  bool check[10000]{false};
  for (int i = 2; i < 10000; ++i) {
    if (!check[i]) {
      sosu.push_back(i);
      for (int j = i * 2; j < 10000; j += i) {
        check[j] = true;
      }
    }
  }
  sosu.push_back(1000000000);
  int time;
  cin >> time;
  int dummy;
  int answer = time;
  vector<int>::iterator place;
  for (int i = 0; i < time; ++i) {
    cin >> dummy;
    for (place = sosu.begin(); *place * *place <= dummy; ++place) {
      if (dummy % *place == 0) {
        --answer;
        break;
      }
    }
  }
  cout << answer << endl;
  return 0;
}

#include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
  vector<int> sosu;
  bool check[10000]{false};
  for (int i = 2; i < 10000; ++i) {
    if (!check[i]) {
      sosu.push_back(i);
      for (int j = i * 2; j < 10000; j += i) {
        check[j] = true;
      }
    }
  }
  sosu.push_back(1000000000);
  int time;
  cin >> time;
  int dummy;
  int answer = time;
  int ch;
  vector<int>::iterator place;
  for (int i = 0; i < time; ++i) {
    cin >> dummy;
    if (dummy == 2)
      continue;
    ch = sqrt((double)dummy) + 1;
    for (place = sosu.begin(); *place <= ch; ++place) {
      if (dummy % *place == 0) {
        --answer;
        break;
      }
    }
  }
  cout << answer << endl;
  return 0;
}


#include <cstdio>

int main(void) {
  int n, x;
  int counter = 0;
  int is_prime = 0;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    if (x == 2) {
      counter++;
      continue;
    }
    if (!(x % 2) || x == 1)
      continue;
    is_prime = 1;
    for (int j = 2; j < x; j++) {
      if (x % j == 0) {
        is_prime = 0;
        break;
      }
    }
    if (is_prime)
      counter++;
  }
  printf("%d\\n", counter);
  return 0;
}

#include <cmath>
#include <cstdio>

int main(void) {
  int n, x;
  int counter = 0;
  int is_prime = 0;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    if (x == 2) {
      counter++;
      continue;
    }
    if (!(x % 2) || x == 1)
      continue;
    is_prime = 1;
    for (int j = 2; j < sqrt(x) + 1; j++) {
      if (x % j == 0) {
        is_prime = 0;
        break;
      }
    }
    if (is_prime)
      counter++;
  }
  printf("%d\\n", counter);
  return 0;
}


#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int maxn = 1e8 + 8;

int a[1000 + 8];
int n, v, j;

void insertSort(int a[]) {
  for (int i = 1; i < n; ++i) {
    v = a[i];
    j = i - 1;
    while (j >= 0 && a[j] > v) {
      a[j + 1] = a[j];
      j--;
    }
    a[j + 1] = v;
  }
}
bool judge(int x) {
  if (x == 2)
    return true;
  if (x < 2)
    return false;
  for (int i = 2; i <= (int)sqrt(x); ++i) {
    if (x % i == 0)
      return false;
  }
  return true;
}
int main() {
  memset(a, 0, sizeof a);

  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  insertSort(a); //??¶??´?????????O(n^2)

  /* for(int i = 0; i < n; ++i){
       if(i) printf(" ");
       printf("%d",a[i]);
   }
   printf("\\n");*/

  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (judge(a[i]))
      cnt++;
  }
  printf("%d\\n", cnt);
  return 0;
}
/*
11
12
13
14
15
16
17
7
8
9
10
11
*/

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int maxn = 1e8 + 8;

int a[10000 + 8];
int n, v, j;

void insertSort(int a[]) {
  for (int i = 1; i < n; ++i) {
    v = a[i];
    j = i - 1;
    while (j >= 0 && a[j] > v) {
      a[j + 1] = a[j];
      j--;
    }
    a[j + 1] = v;
  }
}
bool judge(int x) {
  if (x == 2)
    return true;
  for (int i = 2; i <= (int)sqrt(x); ++i) {
    if (x % i == 0)
      return false;
  }
  return true;
}
int main() {
  memset(a, 0, sizeof a);

  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  insertSort(a); //??¶??´?????????O(n^2)

  /* for(int i = 0; i < n; ++i){
       if(i) printf(" ");
       printf("%d",a[i]);
   }
   printf("\\n");*/

  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (judge(a[i]))
      cnt++;
  }
  printf("%d\\n", cnt);
  return 0;
}
/*
11
12
13
14
15
16
17
7
8
9
10
11
*/


#include <iostream>
using namespace std;
bool snt(int a) {
  if (a == 2 || a == 3)
    return true;
  if (a < 2)
    return false;
  for (int i = 2; i < a; i++)
    if (a % i == 0)
      return false;
  return true;
}

int main() {
  int n, b, d = 0;
  cin >> n;
  while (n > 0) {
    n--;
    cin >> b;
    if (snt(b))
      d++;
  }
  cout << d << endl;

  return 0;
}

#include <iostream>
#include <math.h>
using namespace std;
bool snt(int a) {
  if (a == 2 || a == 3)
    return true;
  if (a < 2)
    return false;
  int n = (int)sqrt(a);
  for (int i = 2; i <= n; i++)
    if (a % i == 0)
      return false;
  return true;
}

int main() {
  int n, b, d = 0;
  cin >> n;
  while (n > 0) {
    n--;
    cin >> b;
    if (snt(b))
      d++;
  }
  cout << d << endl;
  return 0;
}


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

int main() {
  int n, s, j, ct = 0, p[10000];

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

  for (int i = 0; i < n; i++) {
    // s = sqrt(p[i]);
    j = 2;
    while (p[i] % j > 0) {
      // cout << p[i] << " " << j << " " << ct << endl;
      j++;
    }
    if (j == p[i])
      ct++;
  }

  cout << ct << endl;
  return 0;
}

#include <cmath>
#include <iostream>
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(void) {
  // Here your code !
  int n, x, ct = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (isPrime(x))
      ct++;
  }
  cout << ct << endl;

  return 0;
}


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

#define max 100000001

bool isPrime[max];

void make_isPrime(int MAX) {
  for (int i = 0; i < MAX; i++)
    isPrime[i] = true;
  isPrime[0] = isPrime[1] = false;

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

int main() {
  make_isPrime(100000001);
  int n;
  cin >> n;
  vector<int> input;
  for (int i = 0; i < n; i++) {
    int tmp;
    cin >> tmp;
    input.push_back(tmp);
  }
  int ans = 0;
  for (int i = 0; i < input.size(); i++) {
    if (isPrime[input[i]])
      ans++;
  }
  cout << ans << "\\n";
}

#include <iostream>
using namespace std;

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

int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    ans += isPrime(x);
  }
  cout << ans << "\\n";
}


#include <cmath>
#include <iostream>

using namespace std;
int main() {
  int n, x;
  int cnt = 0;
  int flag = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;

    if (x == 2)
      flag = 0;
    else if (x % 2 == 0)
      flag = 1;

    else {
      for (int j = 2; j < x; j++) {
        if (x % j == 0) {
          flag = 1;
          break;
        }
      }
    }
    if (flag == 0)
      cnt++;
    flag = 0;
  }
  cout << cnt << endl;
  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;
int main() {
  int n, x;
  int cnt = 0;
  int flag = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;

    if (x == 2)
      flag = 0;
    else if (x % 2 == 0)
      flag = 1;

    else {
      for (int j = 2; j <= sqrt(x); j++) {
        if (x % j == 0) {
          flag = 1;
          break;
        }
      }
    }
    if (flag == 0)
      cnt++;
    flag = 0;
  }
  cout << cnt << endl;
  return 0;
}


#define _USE_MATH_DEFINES
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {

  bool p[10001] = {false};
  p[2] = true;
  p[3] = true;

  for (int i = 3; i < 10001; i += 2) {
    bool f = false;
    for (int j = 3; j <= sqrt(i); j += 2) {
      if (i % j == 0) {
        f = true;
        break;
      }
    }
    if (!f)
      p[i] = true;
  }

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

  cout << count << endl;
}

#define _USE_MATH_DEFINES
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
bool isprime(int x) {
  if (x == 2)
    return true;
  if (x < 2 || 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;
  int x;
  int count = 0;

  cin >> n;

  while (n > 0) {
    cin >> x;

    if (isprime(x))
      count++;

    n--;
  }

  cout << count << endl;
}


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

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

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

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

unsigned int s[100000000 / 8 + 1];

int bget(int n) { return (s[n / 32] >> (n % 32)) & 1; }

int bset(int n) { s[n / 32] |= 1 << (n % 32); }

void sieve(int n) {
  int m = sqrt(n);
  bset(0);
  bset(1);
  for (int k = 2; k <= m; k++) {
    if (bget(k))
      continue;
    for (int i = 2 * k; i <= n; i += k) {
      bset(i);
    }
  }
}

int main(void) {
  int n;
  sieve(100000000);
  scanf("%d", &n);
  int count = 0;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (!bget(x))
      count++;
  }
  printf("%d\\n", count);
  return 0;
}


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

bool PrimeNumbers(int x) {
  bool Num[x + 1];

  Num[0] = false;
  Num[1] = false;

  /*Numをtrueで初期化。全てが素数候補*/
  for (int i = 2; i <= x; i++) {
    Num[i] = true;
  }

  /*エラトステネスの篩*/
  for (int i = 2; i <= sqrt(x); i++) {
    if (Num[i] == true) // 素数の場合
    {
      for (int j = i; j <= x / i; j++) // 2*2,2*3,,,2*50まで除外されているので
      {
        Num[j * i] =
            false; // 次に3の倍数を削除するとき、3*2をやらないためにj=iとする
        if (Num[x] == false) // Num[x]が素数でなかったら終了
          return Num[x];
      }
    }
  }

  return Num[x];
}

// エラトステネスの篩による素数判定プログラム
int main() {
  int num;
  int count = 0; // 素数の数をカウントする

  while (cin >> num) {
    if (PrimeNumbers(num))
      count++;
  }

  cout << count << endl;

  return 0;
}

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

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

int main() {
  int num;
  int count = 0; // 素数の数をカウントする

  while (cin >> num) {
    if (PrimeNumbers2(num))
      count++;
  }

  cout << count << endl;

  return 0;
}


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

int n;
int c = 0;
int a[10000];
int b[100000000];

int main() {
  cin >> n;
  b[0] = 1;
  b[1] = 1;
  for (int i = 2; i < 100000000; i++) {
    b[i] = 1;
  }

  for (int i = 2; i < 10000; i++) {
    if (b[i] == 1) {
      for (int j = 2; j < 10000; j++)
        b[i * j] = -1;
    }
  }

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

  for (int i = 0; i < n; i++) {
    if (b[a[i]] == 1) {
      c++;
    }
  }

  cout << c << endl;
  return 0;
}

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

int n;
int a[10000];
int s = 0;
int b = 0;

int main() {
  cin >> n;

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

  for (int i = 0; i < n; i++) {
    b = sqrt(a[i]);
    if (a[i] == 2 || a[i] == 3)
      s++;
    for (int j = 2; j < b + 1; j++) {

      if (a[i] % j == 0)
        break;
      if (j == b)
        s++;
    }
  }

  cout << s << endl;

  return 0;
}


#include <iostream>

int main() {
  int n;
  bool if_p[10000];
  for (int i = 0; i < 10000; i++)
    if_p[i] = true;
  if_p[0] = false;
  if_p[1] = true;
  for (int lim = 1; lim < 10000; lim = lim * (lim + 2)) {
    for (int iter = 0; iter <= lim; iter++) {
      if (if_p[iter])
        for (int i = 2; i * (iter + 1) <= 10000; i++)
          if_p[i * (iter + 1) - 1] = false;
    }
  }
  std::cin >> n;
  int count = 0;
  for (; n--;) {
    int input;
    std::cin >> input;
    if (if_p[input - 1])
      count++;
  }
  std::cout << count << std::endl;
  return 0;
}

#include <cmath>
#include <iostream>

int main() {
  int n;
  bool if_p[10000];
  for (int i = 0; i < 10000; i++)
    if_p[i] = true;
  if_p[0] = false;
  if_p[1] = true;
  for (int lim = 1; lim < 10000; lim = lim * (lim + 2)) {
    for (int iter = 0; iter <= lim; iter++) {
      if (if_p[iter])
        for (int i = 2; i * (iter + 1) <= 10000; i++)
          if_p[i * (iter + 1) - 1] = false;
    }
  }
  std::cin >> n;
  int count = 0;
  for (; n--;) {
    int input;
    std::cin >> input;
    bool b = true;
    ;
    for (int i = 0; i <= sqrt(input) - 1; i++) {
      if (if_p[i] && !(input % (i + 1))) {
        b = false;
        break;
      }
    }
    if (b)
      count++;
  }
  std::cout << count << std::endl;
  return 0;
}


#include <iostream>
using namespace std;
#define MAX 10005

int isPrime[MAX], p[MAX], tot;
void init() {
  tot = 0;
  for (int i = 2; i < MAX; i++)
    isPrime[i] = 1;
  for (int i = 2; i < MAX; i++) {
    if (isPrime[i])
      p[tot++] = i;
    for (int j = 0; j < tot && i * p[j] < MAX; j++) {
      isPrime[i * p[j]] = 0;
      if (i % p[j] == 0)
        break;
    }
  }
}
int main() {
  int n, a, sum = 0;
  cin >> n;
  init();
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (isPrime[a])
      sum++;
  }
  cout << sum << endl;
  return 0;
}

#include <iostream>
using namespace std;

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


#include <iostream>
using namespace std;

#define Max 1000000

int isPrime[Max];

int main() {
  int num;
  int i, j, k;
  int count = 0;

  // 配列の初期化
  isPrime[0] = isPrime[1] = 0;
  for (i = 2; i < Max; ++i) {
    isPrime[i] = 1;
  }

  for (i = 2; i < Max; i++) {
    if (isPrime[i] == 1) {
      for (j = 2; i * j <= Max; ++j) {
        isPrime[i * j] = 0;
      }
    }
  }

  cin >> num;
  for (i = 0; i < num; ++i) {
    cin >> k;
    if (isPrime[k] == 1) {
      count++;
    }
  }
  cout << count << endl;
}

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

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

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

  return true;
}

int main() {
  int n, k; // k個の整数
  int count = 0;
  cin >> k;
  for (int i = 0; i < k; ++i) {
    cin >> n;
    if (IsPrime(n)) {
      count++;
    }
  }
  cout << count << endl;
}


#include <iostream>
using namespace std;

int main() {
  int num[10000], i, n, j, cnt = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> num[i];
  }
  for (i = 0; i < n; i++) {
    if (num[i] == 2) {
      cnt++;
    } else {
      for (j = 2; j < num[i]; j++) {
        if ((num[i] % j) == 0)
          break;
      }
      if (j == num[i])
        cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

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

int main() {
  int cnt = 0, x, n, i, j;
  bool flg;
  double rootx;
  int rootintx;
  cin >> n;
  for (i = 0; i < n; i++) {
    flg = true;
    cin >> x;
    if (x == 2) {
      cnt++;
      continue;
    }
    if (x < 2 || !(x % 2)) {
      continue;
    }
    rootx = sqrt(x);
    rootx = ceil(rootx);
    rootintx = int(rootx);
    for (j = 2; j <= rootintx; j++) {
      if (!(x % j)) {
        flg = false;
        break;
      }
    }
    if (flg)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}


#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
inline int getprime(int x) {
  int i = x / 2;
  while (i > 1) {
    if (x % i == 0)
      return 0;
    else
      i--;
  }
  return 1;
}
int main() {
  int n;
  cin >> n;
  int x;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    cnt += getprime(x);
  }
  cout << cnt << endl;
  return 0;
}

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <math.h>
using namespace std;
inline int getprime(int x) {
  int i = sqrt(x);
  while (i > 1) {
    if (x % i == 0)
      return 0;
    else
      i--;
  }
  return 1;
}
int main() {
  int n;
  cin >> n;
  int x;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> x;
    cnt += getprime(x);
  }
  cout << cnt << endl;
  return 0;
}


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

const int N = 100000002;

int prime[N];

int main(void) {
  int n;
  int ans = 0;

  cin >> n;

  for (int i = 0; i < N; i++) {
    prime[i] = 1;
  }
  prime[0] = prime[1] = 0;
  for (int i = 2; i < N; i++) {
    if (prime[i] == 1) {
      for (int j = 2; i * j < N; j++) {
        prime[i * j] = 0;
      }
    }
  }

  /*
  for(int i=0; i<n; i++){
          printf("%d:%d\\n", i, prime[i]);
  }
  */

  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (prime[x] == 1) {
      ans++;
    }
  }

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

  return 0;
}

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

int main(void) {
  int n;
  int ans = 0;

  cin >> n;

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

    int j = 2;
    for (; j <= sqrt(x); j++) {
      if (x % j == 0)
        break;
    }
    if (j > sqrt(x)) {
      ans++;
    }
  }

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

  return 0;
}


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

int main(void) {
  int n;
  int ans = 0;

  cin >> n;

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

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

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

  return 0;
}

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

int main(void) {
  int n;
  int ans = 0;

  cin >> n;

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

    if (x == 2)
      ans++;
    if (x % 2 == 0)
      continue;
    int j = 3;
    for (; j <= sqrt(x); j += 2) {
      if (x % j == 0)
        break;
    }
    if (j > sqrt(x)) {
      ans++;
    }
  }

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

  return 0;
}


#include <iostream>

using namespace std;

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

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

int main() {
  int N, m, num = 0;
  double d;
  cin >> N;
  int j;
  for (int i = 0; i < N; i++) {
    cin >> m;
    d = sqrt(m);
    for (j = 2; j <= (int)d && m % j; j++)
      ;
    if (d < j) {
      num++;
    }
  }
  cout << num << endl;
}


#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  int numberOfPrimeNumber = N;

  for (int i = 0; i < N; i++) {
    int primeNumber;
    cin >> primeNumber;
    for (int j = 2; j < primeNumber; j++) {
      if (primeNumber % j == 0) {
        numberOfPrimeNumber--;
        break;
      }
    }
  }

  cout << numberOfPrimeNumber << endl;

  return 0;
}

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

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

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

int main() {
  int N;
  cin >> N;
  int numberOfPrimeNumber = 0;

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

    if (isPrime(primeNumber)) {
      numberOfPrimeNumber++;
    }
  }

  cout << numberOfPrimeNumber << endl;

  return 0;
}


#include <iostream>
using namespace std;

// bool prinmes[100000000]={true};

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

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

#include <iostream>
using namespace std;

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

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


#include <iostream>
#include <vector>
using namespace std;
//---------------------------------------
bool check_sosu(int x);
//---------------------------------------

int main(void) {
  int num;
  int num_sosu = 0;

  cin >> num;

  for (int i = 0; i < num; i++) {
    int a;
    cin >> a;
    if (check_sosu(a)) { // check_sosu(a)????´???°??????true
      num_sosu++;
    }
  }

  cout << num_sosu << endl;

  return 0;
}
//--------------------------------------------
bool check_sosu(int x) {
  int amari_zero_num = 0;

  for (int i = 1; i <= x; i++) {
    int amari = x % i;
    if (!amari) {
      amari_zero_num++;
    }
  }
  if (amari_zero_num == 2) {
    return true;
  }
  return false;
}

#include <iostream>
#include <math.h>
using namespace std;
//---------------------------------------
bool check_sosu(int x);
//---------------------------------------

int main(void) {
  int num;
  int num_sosu = 0;

  cin >> num;

  for (int i = 0; i < num; i++) {
    int a;
    cin >> a;
    if (check_sosu(a)) { // check_sosu(a)????´???°??????true
      num_sosu++;
    }
  }

  cout << num_sosu << endl;

  return 0;
}
//--------------------------------------------
bool check_sosu(int x) {
  int amari_zero_num = 0;

  for (int i = 1; i <= sqrt(x); i++) {
    int amari = x % i;
    if (!amari) {
      amari_zero_num++;
    }
  }
  if (amari_zero_num == 1) {
    return true;
  }
  return false;
}


#include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <string>
#include <typeinfo>
#include <vector>
#define _USE_MATH_DEFINES
#include <cmath>

using namespace std;

// prime=>true, not prime=>false
// bool isPrime(int i){
//     for(int j=2; j<=i/2; j++){
//         if(i%j==0){
//             return false;
//         }
//     }
//     return true;
// }

bool isPrime(int n) {
  if (n < 2) {
    return false;
  } else if (n == 2) {
    return true;
  }
  if (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 n;
  cin >> n;

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

  int prime_count = 0;
  for (int i = 0; i < n; i++) {
    if (isPrime(n_nums[i])) {
      prime_count += 1;
    }
  }

  cout << prime_count << endl;
  return 0;
}

#include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <string>
#include <typeinfo>
#include <vector>
#define _USE_MATH_DEFINES
#include <cmath>

using namespace std;

// prime=>true, not prime=>false
// bool isPrime(int i){
//     for(int j=2; j<=i/2; j++){
//         if(i%j==0){
//             return false;
//         }
//     }
//     return true;
// }

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

int main() {

  int n;
  cin >> n;

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

  int prime_count = 0;
  for (int i = 0; i < n; i++) {
    if (isPrime(n_nums[i])) {
      prime_count += 1;
    }
  }

  cout << prime_count << endl;
  return 0;
}


#include <iostream>
#include <vector>

using namespace std;

bool is_prime(int64_t n) {
  if (n == 2) {
    return true;
  } else if (n % 2 == 0) {
    return false;
  }

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

  return true;
}

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

  cin >> N;

  for (int32_t i = 0; i < N; i++) {
    int64_t n;
    cin >> n;

    if (is_prime(n)) {
      count++;
    }
  }

  cout << count << endl;

  return 0;
}

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

using namespace std;

bool is_prime(int64_t n) {
  if (n == 2) {
    return true;
  } else if (n % 2 == 0) {
    return false;
  }

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

  return true;
}

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

  cin >> N;

  for (int32_t i = 0; i < N; i++) {
    int64_t n;
    cin >> n;

    if (is_prime(n)) {
      count++;
    }
  }

  cout << count << endl;

  return 0;
}


#include <algorithm>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n, value, i, j, flag, cnt = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> value;
    flag = 1;
    if (value == 2)
      cnt++;
    if (value % 2 == 0)
      continue;
    for (j = 3; j < value; j += 2) {
      if (value % j == 0) {
        flag = 0;
        break;
      }
    }
    if (flag == 1)
      cnt++;
  }
  cout << cnt << endl;
  return 0;
}

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n, value, i, j, flag, cnt = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> value;
    flag = 1;
    if (value == 2)
      cnt++;
    if (value == 1 || value % 2 == 0)
      continue;
    for (j = 3; j * j <= value; j += 2) {
      if (value % j == 0) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) {
      cnt++;
      // cout<<value<<endl;
    }
  }
  cout << cnt << endl;
  return 0;
}


#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::endl;

class primes_list {
public:
  primes_list(void) { primes_list(0); }
  primes_list(size_t i) {
    primes.push_back(false); // is_prime(1)=false
    primes.push_back(true);  // is_prime(2)=false
    gen(i);
  }
  bool is_prime(size_t i) {
    if (primes.size() < i)
      gen(i);
    return primes[i - 1];
  }
  void gen(size_t i) {
    if (primes.size() >= i)
      return;
    try {
      primes.resize(i, true);
    } catch (std::exception e) {
      cout << "error on memory allocation" << endl;
      throw(e);
    }
    for (size_t j = 2; j < i; j++) {
      if (primes[j - 1]) {
        for (int k = j + j; k <= primes.size(); k += j) {
          primes[k - 1] = false;
        }
      }
    }
  }

private:
  std::vector<bool> primes;
};

int main() {
  primes_list p(1000000);
  int n, t, c = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> t;
    if (p.is_prime(t))
      c++;
  }
  cout << c << endl;
}

#include <cmath>
#include <iostream>
using std::cin;
using std::cout;
using std::endl;

bool is_prime(unsigned i) {
  if (i == 2)
    return true;
  if (i == 1 || !(i % 2))
    return false;
  for (unsigned j = 3; j <= sqrt(i); j += 2) {
    if (!(i % j))
      return false;
  }
  return true;
}

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


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
  int n, a, count = 0, flag = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == 2) {
      count++;
    } else {
      for (int j = 2; j < a; j++) {
        if (a % j == 0) {
          flag = 1;
          break;
        }
      }
      if (flag == 0) {
        count++;
      }
    }
    flag = 0;
  }
  cout << count << endl;
  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int x, n, i;
float isprime() {
  int j = 3;
  if (x == 2)
    return true;
  else if (x < 2 || x % 2 == 0)
    return false;
  else {
    while (j <= sqrt(x)) {
      if (x % j == 0) {
        return false;
      }
      j = j + 2;
    }
    return true;
  }
}
int main() {
  int count = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    isprime();
    if (isprime() == true)
      count++;
  }
  cout << count << endl;
  return 0;
}


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

int N, A[10000];

bool isPrimeNumber(int x) {
  if (x != 2 && x % 2 == 0)
    return false;
  for (int i = 2; i < x; i++) {
    if (x % i == 0)
      return false;
  }
  return true;
}

int main(void) {
  cin >> N;

  int cnt = 0, x;
  for (int i = 0; i < N; i++) {
    cin >> x;
    if (isPrimeNumber(x))
      cnt++;
  }
  cout << cnt << endl;
}

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

int N, A[10000];

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

int main(void) {
  cin >> N;

  int cnt = 0, x;
  for (int i = 0; i < N; i++) {
    cin >> x;
    if (isPrimeNumber(x))
      cnt++;
  }
  cout << cnt << endl;
}


#include <iostream>
using namespace std;
void nhapkt(int &n) { cin >> n; }
void NhapMT(int a[], int n) {
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
}
bool isSNT(int k) {
  int d = 0;
  for (int i = 1; i <= k; i++) {
    if (k % i == 0) {
      d++;
    }
  }
  if (d != 2)
    return false;
  return true;
}
void CountPN(int a[], int n) {
  int d = 0;
  for (int i = 0; i < n; i++) {
    if (isSNT(a[i]))
      d++;
  }
  cout << d << endl;
}
int main() {
  int n;
  int a[10000];
  nhapkt(n);
  NhapMT(a, n);
  CountPN(a, n);
}

#include <iostream>
using namespace std;
void nhapkt(int &n) { cin >> n; }
void NhapMT(int a[], int n) {
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
}
bool isSNT(int k) {
  if (k == 2)
    return true;
  if (k < 2 || k % 2 == 0)
    return false;
  for (int i = 3; i * i <= k; i = i + 2) {
    if (k % i == 0)
      return false;
  }
  return true;
}
void CountPN(int a[], int n) {
  int d = 0;
  for (int i = 0; i < n; i++) {
    if (isSNT(a[i]))
      d++;
  }
  cout << d << endl;
}
int main() {
  int n;
  int a[10000];
  nhapkt(n);
  NhapMT(a, n);
  CountPN(a, n);
}


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

// #define int long long
#define ll long long
#define pb push_back
#define vi vector<int>
#define vii vector<vector<int>>

template <class X> void print(X Target) { cout << Target << '\\n'; }

const int MAX = 100000000;

signed main() {
  ios::sync_with_stdio(false);
  static int prime[MAX + 1] = {true, true};

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

  int n, cnt = 0;
  cin >> n;
  while (n--) {
    int num;
    cin >> num;
    if (!prime[num]) {
      cnt++;
    }
  }
  print(cnt);

  return (0);
}

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

// #define int long long
#define ll long long
#define pb push_back
#define vi vector<int>
#define vii vector<vector<int>>

template <class X> void print(X Target) { cout << Target << '\\n'; }

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

  return (true);
}

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

  int n, cnt = 0;
  cin >> n;
  while (n--) {
    int num;
    cin >> num;
    if (isprime(num)) {
      cnt++;
    }
  }
  print(cnt);

  return (0);
}


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

int memo[100000001];
int dp[100000001];

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

  memo[0] = true;
  memo[1] = true;

  int im = sqrt(100000000) + 1;
  for (int i = 2; i <= im; i += 2) {
    if (!memo[i]) {
      for (int j = i * i; j <= 100000000; j += i) {
        memo[j] = true;
      }
    }
  }
  for (int i = 2; i <= im; i++) {
    if (!memo[i])
      dp[i] = dp[i - 1] + 1;
    else
      dp[i] = dp[i - 1];
  }

#ifdef DEBUG
  for (int i = 1; i <= 100; i++) {
    cout << memo[i] << " ";
  }
  cout << endl;
#endif

  int ans = 0;
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    ans = max(ans, dp[x]);
  }
  cout << ans << endl;
}

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

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

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


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

int main() {
  int n, cnt = 0;
  cin >> n;
  while (n--) {
  A:
    int c;
    cin >> c;
    double Sq = sqrt(c);
    for (int i = 2; i <= Sq; i++) {
      if (c % i == 0) {
        n--;
        goto A;
      }
    }
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}

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

int main() {
  int n;
  cin >> n;
  int d[n], max = -1;
  for (int i = 0; i < n; i++) {
    cin >> d[i];
    max = max < d[i] ? d[i] : max;
  }

  vector<int> pr;
  pr.push_back(2);
  for (int i = 3; i <= sqrt(max); i++) {
    for (int j = 0; j < pr.size() && pr[j] <= sqrt(i); j++) {
      if (i % pr[j] == 0)
        goto BREAK;
    }
    pr.push_back(i);
  BREAK:;
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < pr.size() && pr[j] <= sqrt(d[i]); j++) {
      if (d[i] % pr[j] == 0)
        goto BREAK2;
    }
    cnt++;
  BREAK2:;
  }
  cout << cnt << endl;
  return 0;
}


#include <iostream>
#include <vector>

using namespace std;

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

  int cnt = 0;

  vector<int> a(n);

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

    int flag = 1;

    for (int j = 2; j < a[i]; j++) {
      if (a[i] % j == 0) {
        flag = 0;
        break;
      }
    }

    if (flag)
      cnt++;
  }

  cout << cnt << endl;

  return 0;
}

#include <iostream>
#include <vector>

using namespace std;

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

  int cnt = 0;

  vector<int> a(n);

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

    bool flag = true;

    for (int j = 2; j * j <= a[i]; j++) {
      if (a[i] % j == 0) {
        flag = 0;
        break;
      }
    }

    if (flag)
      cnt++;
  }

  cout << cnt << endl;

  return 0;
}


#include <cstdio>

int main(void) {

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

  int c = 0;

  for (i = 0; i < n; i++) {
    int x = 0, y = a[i];
    while (y - x > 1) {
      int z = (x + y) / 2;
      if (z * z >= a[i]) {
        x = z;
      } else {
        y = z;
      }
    }

    int j;
    for (j = 2; j <= y; j++) {
      if (a[i] % j == 0)
        break;
    }
    if (j + 1 > y) {
      c++;
    }
  }

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

  return 0;
}

#include <cmath>
#include <cstdio>
int main(void) {

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

  int c = 0;

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

    int y = sqrt(a[i]);
    //	printf("y=%d\\n",y);
    int j;

    if (y == 1) {
      c++;
    } else {
      for (j = 2; j <= y; j++) {
        // if(a[i]%j==0) {printf("i=%d\\nj=%d\\n",i,j);}
        if (a[i] % j == 0)
          break;
      }
      // printf("%d\\n",j);
      if (j == y + 1) {
        c++;
      }
    }
  }
  printf("%d\\n", c);

  return 0;
}


#include <cmath>
#include <iostream>
using namespace std;
int main() {
  int i, j, n, b = 0;

  cin >> n;

  int a[n];

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

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

    if (a[i] == 2) {
      b++;
      continue;
    }

    else if (a[i] < 2 || a[i] % 2 == 0)
      continue;

    j = 3;

    while (j <= sqrt(a[i]))
      if (a[i] % i == 0)
        break;

    j = j + 2;
    b++;
  }

  cout << b << endl;

  return 0;
}

#include <cmath>
#include <iostream>

int isprime(int);
using namespace std;

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

  cin >> n;

  int a[n];

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

  for (i = 0; i < n; i++) {
    if (isprime(a[i]) == true)
      b++;
  }

  cout << b << endl;

  return 0;
}

int isprime(int x) {
  int j;

  if (x == 2)
    return true;

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

  j = 3;

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

    j = j + 2;
  }

  return true;
}


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

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

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

int main() {
  int a[100000] = {};
  int n;
  int count = 0;

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

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

  return 0;
}


#include <iostream>
using namespace std;

const int LIM = 100000000;
bool notprime[LIM];

void take_prime() {
  notprime[0] = notprime[1] = true;
  int m = 2;
  while (m < 10000) {
    if (!notprime[m]) {
      int j = m * m;
      while (j < LIM) {
        notprime[j] = true;
        j += m;
      }
    }
    m++;
  }
}

int main() {
  take_prime();
  short N, cnt = 0;
  cin >> N;
  while (N-- > 0) {
    short a;
    cin >> a;
    if (!notprime[a]) {
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

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

const int INF = 1000000007;

bool isprime[10000];
int prime[10000];
int lim = 0;

void eratosthenes() {
  for (int i = 0; i < 10000; i++) {
    isprime[i] = true;
  }
  isprime[0] = isprime[1] = false;
  for (int x = 2; x < 10000; x++) {
    if (isprime[x]) {
      prime[lim++] = x;
      for (int y = x * x; y < 10000; y += x) {
        isprime[y] = false;
      }
    }
  }
}

int main() {
  eratosthenes();
  int N, a, ans;
  ans = 0;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &a);
    bool flg = true;
    for (int i = 0; i < lim; i++) {
      if (prime[i] >= a)
        break;
      if (a % prime[i] == 0) {
        flg = false;
        break;
      }
    }
    if (flg)
      ++ans;
  }
  printf("%d\\n", ans);
  return 0;
}


#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
typedef int TInt;
typedef std::vector<TInt> TList;
TList Input() {
  int Count;
  std::cin >> Count;
  TList List(Count);
  for (int i = 0; i < Count; ++i) {
    std::cin >> List[i];
  }
  return List;
}
// ?????????????????°??????????????????
struct TIsDivisibility {
  const TInt FValue;
  TIsDivisibility(const TInt &Value) : FValue(Value) {}
  bool operator()(TInt Prime) { return FValue % Prime == 0; }
};
bool IsPrime(TInt Value, const TList &Prime) {
  TInt Max = std::sqrt(Value);
  for (TList::const_iterator It = Prime.begin();
       It != Prime.end() && *It <= Max; ++It) {
    if (Value % (*It) == 0)
      return false;
  }
  return true;
}
TList GetPrimeNumber(TInt Max) {
  TList Prime;
  Prime.reserve(Max);
  Prime.push_back(2);
  for (TInt i = 3; i <= Max; i += 2) {
    if (IsPrime(i, Prime)) {
      Prime.push_back(i);
    }
  }
  return Prime;
}
struct TIsPrime {
  const TList &FPrime;
  TIsPrime(const TList &Prime) : FPrime(Prime) {}
  bool operator()(const TInt &Value) {
    return std::binary_search(FPrime.begin(), FPrime.end(), Value);
  }
};
void Output(const TList &List) {
  for (TList::const_iterator It = List.begin(); It != List.end(); ++It) {
    std::cout << *It << std::endl;
  }
}
int main() {
  TList Values = Input();
  TInt Max = *std::max_element(Values.begin(), Values.end());
  // std::cout << "Max:" << Max << std::endl;
  TList Prime = GetPrimeNumber(Max);
  // Output(Prime);
  // std::cout << "Size:" << Prime.size() << std::endl;
  int Count = std::count_if(Values.begin(), Values.end(), TIsPrime(Prime));
  std::cout << Count << std::endl;
  return 0;
}

#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
typedef int TInt;
typedef std::vector<TInt> TList;
TList Input() {
  int Count;
  std::cin >> Count;
  TList List(Count);
  for (int i = 0; i < Count; ++i) {
    std::cin >> List[i];
  }
  return List;
}
// ?????????????????°??????????????????
struct TIsDivisibility {
  const TInt FValue;
  TIsDivisibility(const TInt &Value) : FValue(Value) {}
  bool operator()(TInt Prime) { return FValue % Prime == 0; }
};
bool IsPrime(TInt Value, const TList &Prime) {
  TInt Max = std::sqrt(Value);
  for (TList::const_iterator It = Prime.begin();
       It != Prime.end() && *It <= Max; ++It) {
    if (Value % (*It) == 0)
      return false;
  }
  return true;
}
TList GetPrimeList(TInt Max) {
  TList Prime;
  Prime.reserve(Max);
  Prime.push_back(2);
  for (TInt i = 3; i <= Max; i += 2) {
    if (IsPrime(i, Prime)) {
      Prime.push_back(i);
    }
  }
  return Prime;
}
struct TIsPrimeFullList {
  const TList &FPrime;
  TIsPrimeFullList(const TList &PrimeFullList) : FPrime(PrimeFullList) {}
  bool operator()(const TInt &Value) {
    return std::binary_search(FPrime.begin(), FPrime.end(), Value);
  }
};
struct TIsPrimeRootList {
  const TList &FPrime;
  TIsPrimeRootList(const TList &PrimeRootList) : FPrime(PrimeRootList) {}
  bool operator()(const TInt &Value) { return IsPrime(Value, FPrime); }
};
void Output(const TList &List) {
  for (TList::const_iterator It = List.begin(); It != List.end(); ++It) {
    std::cout << *It << std::endl;
  }
}
int main() {
  TList Values = Input();
  std::sort(Values.begin(), Values.end());
  TInt Max = *Values.rbegin();
  // std::cout << "Max:" << Max << std::endl;
  TList::iterator Root =
      std::lower_bound(Values.begin(), Values.end(), std::sqrt(Max));
  // std::cout << "Root" << *Root << std::endl;
  TList Prime = GetPrimeList(*Root);
  // Output(Prime);
  // std::cout << "Size:" << Prime.size() << std::endl;
  int Count = std::count_if(Values.begin(), Root, TIsPrimeFullList(Prime));
  Count += std::count_if(Root, Values.end(), TIsPrimeRootList(Prime));
  std::cout << Count << std::endl;
  return 0;
}


#include <algorithm>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;

constexpr int INF = 1000000000; /* 1e+9a */
constexpr int MODULO = 1000000007;

constexpr int evx[4] = {1, 0, -1, 0};
constexpr int evy[4] = {0, 1, 0, -1};

//----------------------------------
//----------------------------------

constexpr int Sup = 50000000;
bool number[Sup];
vector<int> primes;

void era() {
  for (int i = 0; i < Sup; ++i) {
    number[i] = true;
  }

  primes.push_back(2);
  primes.push_back(3);
  int prime = 1; // 2n + 1 -> n
  while (true) {
    int add = 2 * prime + 1;
    for (int i = prime + add; i < Sup; i += add) {
      number[i] = false;
    }
    int j = prime + 1;
    while (true) {
      if (j >= Sup)
        return;
      else if (number[j]) {
        prime = j;
        primes.push_back(2 * prime + 1);
        break;
      }
      j++;
    }
  }
}

signed main() {
  ios::sync_with_stdio(false);
  era();
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp;
    ans += binary_search(primes.begin(), primes.end(), tmp);
  }
  cout << ans << '\\n';
}

#include <algorithm>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;

constexpr int INF = 1000000000; /* 1e+9a */
constexpr int MODULO = 1000000007;

constexpr int evx[4] = {1, 0, -1, 0};
constexpr int evy[4] = {0, 1, 0, -1};

//----------------------------------
//----------------------------------

constexpr int Sup = 5000;
bool number[Sup];
vector<int> primes;

void era() {
  for (int i = 0; i < Sup; ++i) {
    number[i] = true;
  }

  primes.push_back(2);
  primes.push_back(3);
  int prime = 1; // 2n + 1 -> n
  while (true) {
    int add = 2 * prime + 1;
    for (int i = prime + add; i < Sup; i += add) {
      number[i] = false;
    }
    int j = prime + 1;
    while (true) {
      if (j >= Sup)
        return;
      else if (number[j]) {
        prime = j;
        primes.push_back(2 * prime + 1);
        break;
      }
      j++;
    }
  }
}

inline bool test_divid(int n) {
  if (n < 10000)
    return binary_search(primes.begin(), primes.end(), n);
  else
    for (auto p : primes) {
      if (n % p == 0)
        return false;
    }
  return true;
}

signed main() {
  ios::sync_with_stdio(false);
  era();
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp;
    ans += test_divid(tmp);
  }
  cout << ans << '\\n';
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = 1e9;

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

int main() {
  int n = 0;
  fscanf(stdin, "%d", &n);
  int cnt = 0;
  vector<int> memo(10005, -1);
  for (int i = 0; i < n; ++i) {
    int m = 0;
    fscanf(stdin, "%d", &m);
    if (memo[m] != -1) {
      cnt += memo[m];
    } else if (is_prime(m)) {
      ++cnt;
      memo[m] = 1;
    } else {
      memo[m] = 0;
    }
  }
  fprintf(stdout, "%d\\n", cnt);
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int INF = 1e9;

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

int main() {
  int n = 0;
  fscanf(stdin, "%d", &n);
  int cnt = 0;
  map<int, int> memo;
  for (int i = 0; i < n; ++i) {
    int m = 0;
    fscanf(stdin, "%d", &m);
    if (memo.count(m)) {
      cnt += memo[m];
    } else if (is_prime(m)) {
      ++cnt;
      memo[m] = 1;
    } else {
      memo[m] = 0;
    }
  }
  fprintf(stdout, "%d\\n", cnt);
  return 0;
}


#include <cstdio>
using namespace std;
int prime[10000];
int p[10000];
int main() {
  for (int i = 2; i < 10000; i++) {
    for (int j = i * j; j < 10000; j += i)
      prime[j] = 1;
  }
  int cnt = 0;
  for (int i = 2; i < 10000; i++) {
    if (prime[i] == 0) {
      p[cnt] = i;
      cnt++;
    }
  }
  int n, q, z;
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    scanf("%d", &n);
    bool OK = true;
    for (int j = 0; j < cnt; j++) {
      if (n % p[j] == 0)
        OK = false;
    }
    if (OK == true)
      z++;
  }
  printf("%d\\n", z);
  return 0;
}

#include <cstdio>
using namespace std;
int prime[10000];
int p[10000];
int c[10000];
int main() {
  for (int i = 2; i * i < 10000; i++) {
    for (int j = i * i; j < 10000; j += i)
      prime[j] = 1;
  }
  int cnt = 0;
  for (int i = 2; i < 10000; i++) {
    if (prime[i] == 0) {
      p[cnt] = i;
      cnt++;
    }
  }
  int n, q, z = 0;
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    scanf("%d", &n);
    bool OK = true;
    for (int j = 0; j < cnt; j++) {
      if (n < p[j] * p[j])
        break;
      if (n % p[j] == 0)
        OK = false;
    }
    if (OK == true)
      z++;
  }
  printf("%d\\n", z);
  return 0;
}


#include <cstdlib>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>

using namespace std;

class c_primeNumber {
private:
  int n;
  int x[10000];

public:
  void f_primeNumber1();
  int f_primeNumber2(int x);
};

void c_primeNumber::f_primeNumber1() {
  int i;
  int c = 0;

  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> x[i];
    if (c_primeNumber::f_primeNumber2(x[i]) == 1) {
      c = c + 1;
    }
  }
  cout << n - c << endl;
}

int c_primeNumber::f_primeNumber2(int x) {
  int i;

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

  return 0;
}

int main() {
  c_primeNumber primeNumber01;

  primeNumber01.f_primeNumber1();

  return 0;
}

#include <cstdlib>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string.h>

using namespace std;

int f_primeNumber2(int x) {
  int i;

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

  return 0;
}

int main() {
  int n;
  int x[10000];
  int i;
  int c = 0;

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

  for (i = 0; i < n; ++i) {
    if (f_primeNumber2(x[i]) == 1) {
      c = c + 1;
    }
  }
  cout << n - c << endl;

  return 0;
}


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

bool isPrime(int val);
int countPrime(vector<int> &array);

int main() {
  int size;
  vector<int> array;
  cin >> size;
  for (int i = 0; i < size; i++) {
    int tmp;
    cin >> tmp;
    array.push_back(tmp);
  }
  cout << countPrime(array) << endl;
  return 0;
}

int countPrime(vector<int> &array) {
  int num = 0;
  for (int i = 0; i < array.size(); i++) {
    if (isPrime(array[i])) {
      num++;
    }
  }
  return num;
}

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

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

bool isPrime(int val);
int countPrime(vector<int> &array);

int main() {
  int size;
  vector<int> array;
  cin >> size;
  for (int i = 0; i < size; i++) {
    int tmp;
    cin >> tmp;
    array.push_back(tmp);
  }
  cout << countPrime(array) << endl;
  return 0;
}

int countPrime(vector<int> &array) {
  int num = 0;
  for (int i = 0; i < array.size(); i++) {
    if (isPrime(array[i])) {
      num++;
    }
  }
  return num;
}

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


#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;

int main(void) {
  int n;
  int a[10000];
  int i, j;

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

  int ans = 0;

  for (i = 0; i < n; i++) {
    j = 2;
    while (a[i] % j != 0) {
      j++;
    }
    if (a[i] == j)
      ans++;
  }

  cout << ans << endl;

  return 0;
}

#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;

int main(void) {
  int n;
  int a[10000];
  int i, j;

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

  int ans = 0;

  for (i = 0; i < n; i++) {
    j = 2;
    int m = sqrt(a[i]);
    while (a[i] % j != 0 && j <= m) {
      j++;
    }
    if (j > m)
      ans++;
  }

  cout << ans << endl;

  return 0;
}


#include <iostream>
using namespace std;

int main() {
  int n, pn, a, b, tmp, pnn, pnc = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pn;
    pnn = 1;
    for (int j = 2; j < pn / 2 + 1; j++) {
      if ((pnn % 2) || (pnn % 3) || (pnn % 5) || (pnn % 7) || (pnn % 11) ||
          (pnn % 13)) {
        a = pn;
        b = j;
        while (b != 0) {
          tmp = b;
          b = a % b;
          a = tmp;
        }
        if (a == 1)
          pnn *= 1;
        else {
          pnn *= 0;
          break;
        }
      } else
        pnn *= 0;
    }
    if (pnn == 1)
      pnc += 1;
  }
  cout << pnc << endl;
  return 0;
}

#include <iostream>
using namespace std;

int main() {
  int n, pn, pnc = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pn;
    if ((pn == 2) || (pn == 3))
      pnc += 1;
    else if (pn % 2 == 0) {
    } else {
      for (int j = 3; j <= pn / j; j += 2) {
        if (pn % j == 0) {
          pnc -= 1;
          break;
        }
      }
      pnc += 1;
    }
  }
  cout << pnc << endl;
  return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define rep(i, from, to) for (int i = from; i < to; ++i)
#define REP(i, from, to) for (int i = from; i <= to; ++i)
using namespace std;
template <typename T>
ostream &operator<<(ostream &out, const vector<vector<T>> &v) {
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i] << endl;
  }
  return out;
}
template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) {
  out << "[";
  size_t last = v.size() - 1;
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i];
    if (i != last) {
      out << ",";
    }
  }
  out << "]";
  return out;
}
const int maxn = 10010;
bool p[maxn];
int n;
void eratos() {
  p[0] = p[1] = true;
  rep(i, 0, maxn) {
    if (p[i]) {
      continue;
    }
    for (int j = i + i; j < maxn; j += i) {
      p[j] = true;
    }
  }
}
void solve() {
  eratos();
  cin >> n;
  int ans = 0;
  rep(i, 0, n) {
    int k;
    cin >> k;
    if (!p[k]) {
      ans++;
    }
  }
  cout << ans << endl;
}

int main() { solve(); }

#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define rep(i, from, to) for (int i = from; i < to; ++i)
#define REP(i, from, to) for (int i = from; i <= to; ++i)
using namespace std;
template <typename T>
ostream &operator<<(ostream &out, const vector<vector<T>> &v) {
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i] << endl;
  }
  return out;
}
template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) {
  out << "[";
  size_t last = v.size() - 1;
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i];
    if (i != last) {
      out << ",";
    }
  }
  out << "]";
  return out;
}

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

void solve() {
  cin >> n;
  int ans = 0;
  rep(i, 0, n) {
    int k;
    cin >> k;
    if (isPrime(k)) {
      ans++;
    }
  }
  cout << ans << endl;
}

int main() { solve(); }


#include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <string>
#include <typeinfo>
#include <vector>
#define _USE_MATH_DEFINES
#include <cmath>

using namespace std;

// prime=>true, not prime=>false
bool primeJudge(int i) {
  for (int j = 2; j <= i / 2; j++) {
    if (i % j == 0) {
      return false;
    }
  }
  return true;
}

int main() {

  int n;
  cin >> n;

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

  int prime_count = 0;
  for (int i = 0; i < n; i++) {
    if (primeJudge(n_nums[i])) {
      prime_count += 1;
    }
  }

  cout << prime_count << endl;
  return 0;
}

#include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <string>
#include <typeinfo>
#include <vector>
#define _USE_MATH_DEFINES
#include <cmath>

using namespace std;

// prime=>true, not prime=>false
// bool isPrime(int i){
//     for(int j=2; j<=i/2; j++){
//         if(i%j==0){
//             return false;
//         }
//     }
//     return true;
// }

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

int main() {

  int n;
  cin >> n;

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

  int prime_count = 0;
  for (int i = 0; i < n; i++) {
    if (isPrime(n_nums[i])) {
      prime_count += 1;
    }
  }

  cout << prime_count << endl;
  return 0;
}


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

void Makepn(vector<int> &v, int n) {
  int count = 1;
  int i, j;
  vector<bool> pn(n + 1, true);
  pn[0] = false;
  pn[1] = false;
  for (i = 2; i < sqrt(n); i++) {
    if (pn[i]) {
      for (j = 0; i * (j + 2) < n; j++) {
        pn[i * (j + 2)] = false;
      }
    }
  }
  for (i = 2; i < n; i++) {
    if (pn[i]) {
      count++;
    }
  }
  v.resize(count);

  v[0] = 2;
  j = 1;
  for (i = 3; i <= n; i += 2) {
    if (pn[i]) {
      v[j++] = i;
    }
  }
  return;
}

int main() {
  ios::sync_with_stdio(false);
  vector<int> pn;
  Makepn(pn, 10000);
  int n, num, ans;
  cin >> n;
  ans = n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    for (int j = 0; j < pn.size(); j++) {
      if (pn[j] * pn[j] > num)
        break;
      if (num % pn[j] == 0) {
        ans--;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

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

void Makepn(vector<int> &v, int n) {
  int count = 0;
  int i, j;
  vector<bool> pn(n + 1, true);
  pn[0] = false;
  pn[1] = false;
  for (i = 2; i < sqrt(n); i++) {
    if (pn[i]) {
      for (j = 0; i * (j + 2) < n; j++) {
        pn[i * (j + 2)] = false;
      }
    }
  }
  for (i = 2; i < n; i++) {
    if (pn[i]) {
      count++;
    }
  }
  v.resize(count);

  v[0] = 2;
  j = 1;
  for (i = 3; i <= n; i += 2) {
    if (pn[i]) {
      v[j++] = i;
    }
  }
  return;
}

int main() {
  ios::sync_with_stdio(false);
  vector<int> pn;
  Makepn(pn, 10000);
  int n, num, ans;
  cin >> n;
  ans = n;
  for (int i = 0; i < n; i++) {
    cin >> num;
    for (int j = 0; j < pn.size(); j++) {
      if (pn[j] * pn[j] > num)
        break;
      if (num % pn[j] == 0) {
        ans--;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


#include <iostream>
using namespace std;

int main(void) {
  int n, i, j, ans = 0;
  long num;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> num;
    for (j = 2; j < num; j++)
      if (num % j == 0 && num != j) {
        num = 0;
        break;
      }
    num != 0 ? ans++ : 1;
  }
  cout << ans << endl;
}

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

int main(void) {
  int n, i, j, ans = 0, end;
  long num;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> num;
    num < 10000 ? end = num : end = 10000;
    for (j = 2; j < end; j++)
      if (num % j == 0 && num != j) {
        num = 0;
        break;
      }
    num != 0 ? ans++ : 1;
  }
  cout << ans << endl;
}


#include <cmath>
#include <iostream>
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 * i <= x) {
    if (x % i == 0) {
      return false;
      i += 2;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int count = 0;
  int a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (isPrime(a)) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}

#include <cmath>
#include <iostream>
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 * i <= x) {
    if (x % i == 0) {
      return false;
    }
    i += 2;
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  int count = 0;
  int a;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (isPrime(a)) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}


#include <iostream>
using namespace std;
int main(void) {
  int n, x, i, j, k, l;
  cin >> n;
  l = 0;
  for (i = 0; i < n; i++) {
    cin >> x;
    if (x == 2)
      l++;
    else if (x % 2 == 0) {
    } else {
      k = 0;
      for (j = 1; j <= x; j++) {
        if (x % j == 0)
          k++;
      }
      if (k == 2)
        l++;
    }
  }
  cout << l << endl;
}

#include <iostream>
#include <math.h>
using namespace std;
int isPrime(int n) {
  int i;
  if (n == 2)
    return true;
  else if (n < 2 || n % 2 == 0)
    return false;
  else {
    i = 3;
    while (i <= sqrt(n)) {
      if (n % i == 0)
        return false;
      i += 2;
    }
  }
  return true;
}

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


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

using namespace std;

const int maxn = 1e8 + 5;

int isprime[maxn];

void maketable() {
  isprime[0] = isprime[1] = 1;
  int n = ceil(sqrt(maxn));
  for (int i = 2; i <= n; i++) {
    if (!isprime[i]) {
      for (int j = i + i; j < maxn; j += i) {
        isprime[j] = 1;
      }
    }
  }
}

int main() {
  maketable();
  int s, n, cnt = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &s);
    if (!isprime[s]) {
      cnt++;
    }
  }
  printf("%d\\n", cnt);
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int maxn = 50001;

int prime[maxn], cnt, res;
bool isprime[maxn];

void maketable() {
  int base = (int)sqrt((double)maxn);
  isprime[0] = isprime[1] = 1;
  for (int i = 2; i < maxn; i++) {
    if (!isprime[i]) {
      prime[cnt++] = i;
      for (int j = i + i; j < maxn; j += i) {
        isprime[j] = 1;
      }
    }
  }
}

void solve(int n) {
  int k = (int)sqrt((double)n);
  for (int i = 0; prime[i] <= k; i++) {
    if (n % prime[i] == 0) {
      return;
    }
  }
  res++;
}

int main() {
  maketable();
  int n, s;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &s);
    solve(s);
  }
  printf("%d\\n", res);
  return 0;
}


#include <stdio.h>

#define N_MAX 10000

bool prime[N_MAX + 1];

int main() {
  for (int i = 0; i <= N_MAX; i++) {
    prime[i] = true;
  }
  prime[1] = false;
  for (int i = 2; i <= N_MAX; i++) {
    if (prime[i] == false)
      continue;

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

  int n;
  scanf("%d", &n);

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

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

#include <stdio.h>

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

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

  int count = 0;
  for (int i = 0; i < n; i++) {
    int num;
    scanf("%d", &num);
    if (isPrime(num)) {
      count++;
    }
  }

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


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

int main(void) {
  int x[100000000], y, d, a, b, n;
  double c;
  cin >> n;
  for (a = 0; a < n; a++) {
    cin >> c;
    if (c == 2) {
    } else if (x[a] % 2 == 0) {
      y++;
    } else if (c == 1) {
      y++;
    } else {
      for (b = 3; sqrt(c) >= b; b = b + 2) {
        if (x[a] % b == 0) {
          y++;
          break;
        }
      }
    }
  }
  d = n - y;
  cout << d << endl;
  return 0;
}

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

int main(void) {
  int n, a, b, count, c, w;
  double d;
  n = 0;
  b = 0;
  cin >> n;
  // cout<<"n="<<n<<endl;
  count = 0;
  for (a = 0; a < n; a++) {
    cin >> b;
    d = b;
    // cout<<b<<" ";
    for (w = 0; w <= 0; w++) {
      if (b == 2) {
        break;
      }
      if (b % 2 == 0 || b == 1) {
        // cout<<"NO"<<endl;
        count++;
        break;
      }
      for (c = 3; sqrt(d) >= c; c = c + 2) {
        if (b % c == 0) {
          count++;
          // cout<<"NO"<<endl;
          break;
        }
      }
    }
  }
  cout << n - count << endl;
  return 0;
}


#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define MAX 10000001

static bool gosei[MAX];

void a() {
  for (int i = 2; i <= sqrt(MAX); i++)
    if (gosei[i] == false) {
      for (int j = 2, k = 0; (k = i * j) <= MAX; j++)
        gosei[k] = true;
    }
}

int main() {
  a();
  int b = 0;
  for (int a; cin >> a;)
    if (!gosei[a])
      b++;
  cout << b << endl;
  return 0;
}

#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define MAX 10000001

static bool gosei[MAX];

void a() {
  for (int i = 2; i <= sqrt(MAX); i++)
    if (gosei[i] == false) {
      for (int j = 2, k = 0; (k = i * j) <= MAX; j++)
        gosei[k] = true;
    }
}

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

int main() {
  a();
  int b = 0;
  for (int a; cin >> a;) {
    if (a < MAX) {
      if (!gosei[a])
        b++;
    } else
      b += c(a);
  }
  cout << b << endl;
  return 0;
}


#include <iostream>
int main() {
  using namespace std;
  int len;
  cin >> len;
  int *prime = new int[len];
  int *num = new int[len];
  int count = 0;
  for (int i = 0; i < len; i++) {
    cin >> num[i];
    int isprime = 1;
    for (int j = 0; j < count; j++) {
      if (num[i] % prime[j] == 0 && num[i] != prime[j]) {
        isprime = 0;
        break;
      }
    }
    if (!isprime)
      continue;
    for (int j = 2; j < num[i]; j++) {
      if (num[i] % j == 0 && num[i] != j) {
        isprime = 0;
        break;
      }
    }
    if (isprime)
      prime[count++] = num[i];
  }
  cout << count << endl;
  return 0;
}

#include <cmath>
#include <iostream>
int main() {
  using namespace std;
  int len;
  cin >> len;
  int *prime = new int[len];
  int *num = new int[len];
  int count = 0;
  for (int i = 0; i < len; i++) {
    cin >> num[i];
    int isprime = 1;
    for (int j = 0; j < count; j++) {
      if (num[i] % prime[j] == 0 && num[i] != prime[j]) {
        isprime = 0;
        break;
      }
    }
    if (!isprime)
      continue;
    for (int j = 2; j <= sqrt(num[i]); j++) {
      if (num[i] % j == 0 && num[i] != j) {
        isprime = 0;
        break;
      }
    }
    if (isprime)
      prime[count++] = num[i];
  }
  cout << count << endl;
  return 0;
}


#include <cmath>
#include <iostream>

using namespace std;

class mybitset {
  char *mem;
  int size;
  bool ismemfree;

public:
  mybitset() { ismemfree = true; }
  void setsize(int size) {
    this->size = size;
    mem = new char[size / sizeof(char) + 1];
    ismemfree = false;
  }
  ~mybitset() {
    if (!ismemfree) {
      delete[] mem;
    }
  }
  bool get(int pos) {
    char bit = 1 << (pos % sizeof(char));
    return (mem[pos / sizeof(char)] & bit) != 0;
  };
  void set(int pos) {
    char bit = 1 << (pos % sizeof(char));
    mem[pos / sizeof(char)] |= bit;
  };
  void reset(int pos) {
    char bit = ~(1 << (pos % sizeof(char)));
    mem[pos / sizeof(char)] &= bit;
  }
};

class primer {
  mybitset isprime;

public:
  bool getPrime(int number);
  primer(int max);
};

bool primer::getPrime(int number) { return isprime.get(number); }
primer::primer(int max) {
  isprime.setsize(max + 1);
  //??¨??????????????????????????§?´???°?????????????????????
  isprime.reset(0);
  isprime.reset(1);
  for (int i = 2; i < max; i++) {
    isprime.set(i);
  }
  for (int i = 2; i < sqrt(max); i++) {
    if (isprime.get(i)) {
      for (int j = 2; i * j < max; j++) {
        isprime.reset(i * j);
      }
    }
  }
}

int main(int argc, char const *argv[]) {
  int count;
  cin >> count;
  int prime_count = 0;
  primer p = primer(100000000);
  for (int i = 0; i < count; i++) {
    int number;
    cin >> number;
    if (p.getPrime(number)) {
      prime_count++;
    }
  }
  cout << prime_count << endl;
  return 0;
}

#include <cassert>
#include <cmath>
#include <iostream>

using namespace std;

class mybitset {
  unsigned int *mem;
  int size;
  bool ismemfree;

public:
  mybitset() { ismemfree = true; }
  void setsize(int size) {
    this->size = size;
    mem = new unsigned int[size / sizeof(unsigned int) + 1];
    ismemfree = false;
  }
  ~mybitset() {
    if (!ismemfree) {
      delete[] mem;
    }
  }
  bool get(int pos) {
    char bit = 1 << (pos % sizeof(unsigned int));
    return (mem[pos / sizeof(unsigned int)] & bit) != 0;
  };
  void set(int pos) {
    char bit = 1 << (pos % sizeof(unsigned int));
    mem[pos / sizeof(unsigned int)] |= bit;
  };
  void reset(int pos) {
    char bit = ~(1 << (pos % sizeof(unsigned int)));
    mem[pos / sizeof(unsigned int)] &= bit;
  }
};

class primer {
  mybitset isprime;
  int max;

public:
  bool getPrime(int number);
  primer(int max);
};

bool primer::getPrime(int number) {
  assert(max * max > number);
  if (max > number) {
    return isprime.get(number);
  }
  for (int i = 0; i < max; i++) {
    if (isprime.get(i)) {
      if (number % i == 0) {
        return false;
      }
    }
  }
  return true;
}
primer::primer(int max) {
  this->max = max;
  isprime.setsize(max + 1);
  //??¨??????????????????????????§?´???°?????????????????????
  isprime.reset(0);
  isprime.reset(1);
  for (int i = 2; i < max; i++) {
    isprime.set(i);
  }
  for (int i = 2; i < sqrt(max); i++) {
    if (isprime.get(i)) {
      for (int j = 2; i * j < max; j++) {
        isprime.reset(i * j);
      }
    }
  }
}

int main(int argc, char const *argv[]) {
  int count;
  cin >> count;
  int prime_count = 0;
  primer p = primer(11000);
  for (int i = 0; i < count; i++) {
    int number;
    cin >> number;
    if (p.getPrime(number)) {
      prime_count++;
    }
  }
  cout << prime_count << endl;
  return 0;
}


#include <iostream>
#include <vector>

template <typename T> T Input() {
  T value;
  std::cin >> value;
  return value;
}

int main() {
  bool isPrime[100001];
  for (auto i = 0; i < 100000; ++i)
    isPrime[i] = false;

  for (auto i = 3; i <= 100000; i += 2)
    isPrime[i] = true;

  isPrime[2] = true;

  for (auto i = 3; i * i <= 100000; i += 2)
    if (isPrime[i] == true)
      for (auto j = i * i; j <= 100000; j += i)
        isPrime[j] = false;

  int num, count = 0;
  std::vector<int> arr;

  std::cin >> num;

  for (auto i = 0; i < num; ++i)
    arr.push_back(Input<int>());

  for (auto elem : arr)
    if (isPrime[elem])
      ++count;

  std::cout << count << "\\n";

  return 0;
}

#include <iostream>
#include <vector>

template <typename T> T Input() {
  T value;
  std::cin >> value;
  return value;
}

int main() {
  std::vector<bool> isPrime(100000001);
  for (auto i = 0; i < 100000000; ++i)
    isPrime[i] = false;

  for (auto i = 3; i <= 100000000; i += 2)
    isPrime[i] = true;

  isPrime[2] = true;

  for (auto i = 3; i * i <= 100000000; i += 2)
    if (isPrime[i] == true)
      for (auto j = i * i; j <= 100000000; j += i)
        isPrime[j] = false;

  int num, count = 0;
  std::vector<int> arr;

  std::cin >> num;

  for (auto i = 0; i < num; ++i)
    arr.push_back(Input<int>());

  for (auto elem : arr)
    if (isPrime[elem])
      ++count;

  std::cout << count << "\\n";

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

static bool is_prime[100000001];

int main() {
  memset(is_prime, true, sizeof(is_prime));
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i * i < 100000000; i += 2) {
    if (is_prime[i]) {
      for (int j = i * i; j <= 100000000; j += i) {
        is_prime[j] = false;
        if (i != 2) {
          j += i;
        }
      }
      if (i == 2) {
        --i;
      }
    }
  }
  int ans = 0, n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int num;
    scanf("%d", &num);
    ans += is_prime[num];
  }
  printf("%d\\n", ans);
  return 0;
}

#include <iostream>
#include <vector>

using namespace std;

vector<bool> isPrime(10001, true);
vector<int> primeNumbers;

int main() {
  isPrime[0] = isPrime[1] = false;
  for (int i = 2; i * i <= 10000; i += 2) {
    if (!isPrime[i])
      continue;
    for (int j = i * i; j <= 10000; j += i) {
      isPrime[j] = false;
    }
    i -= i == 2;
  }
  int n, ans = 0;
  for (int i = 0; i <= 10000; i++) {
    if (isPrime[i]) {
      primeNumbers.push_back(i);
    }
  }
  cin >> n;
  while (n--) {
    int a;
    cin >> a;
    if (a <= 1e4) {
      ans += isPrime[a];
      continue;
    }
    ans++;
    for (int i = 0;
         i < primeNumbers.size() && primeNumbers[i] * primeNumbers[i] <= a;
         i++) {
      if (a % primeNumbers[i] == 0) {
        ans--;
        break;
      }
    }
  }
  cout << ans << "\\n";
}


#include <cmath>
#include <iostream>

using namespace std;

bool check_prime(int n) {
  bool res = true;

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

  double r = n / 2;
  for (int i = 2; i < r; i++) {
    if (n % i == 0) {
      res = false;
      break;
    }
  }
  return res;
}

int main() {
  int n, counter = 0;
  cin >> n;
  while (n--) {
    int a;
    cin >> a;
    if (check_prime(a))
      counter++;
  }
  cout << counter << endl;
  return 0;
}

#include <cmath>
#include <iostream>

using namespace std;

bool check_prime(int n) {
  if (n % 2 == 0) {
    if (n != 2)
      return false;
  }

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

  return true;
  ;
}

int main() {
  int n, counter = 0;
  cin >> n;
  while (n--) {
    int a;
    cin >> a;
    if (check_prime(a))
      counter++;
  }
  cout << counter << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

bool isprime(int x);

int main() {
  int i, j;
  int a, n;
  int ans = 0;

  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> a;
    if (isprime(a) == true)
      ans++;
  }

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

  return (0);
}

bool isprime(int x) {
  int i = 3;

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

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

  return (true);
}

#include <bits/stdc++.h>

using namespace std;

bool isprime(int x);

int main() {
  int i, j;
  int a, n;
  int ans = 0;

  cin >> n;

  for (i = 0; i < n; i++) {
    cin >> a;
    if (isprime(a) == true)
      ans++;
  }

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

  return (0);
}

bool isprime(int x) {
  int i = 3;

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

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

  return (true);
}