#include <bits/stdc++.h>
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;
}
