#include<iostream> 

using namespace std;

int prime(int arr[], int num) {
    int count = 0;
    bool isPrime = true;
    for(int i = 0; i < num; i++) {
        if(a[i] != 1 && a[i] != 2) {
            for(int j = 3; j < arr[i]; j += 2) {
                if(arr[i] % j == 0) {
                    isPrime = false;
                    break;
                }
            }    
        }

        if(isPrime)   
            count++;

        isPrime = true;
    }
    return count;
}

int main(){ 
    int num, *arr;
    cin >> num;
    arr = new int[num];
    for(int i = 0; i < num; i++) {
        cin >> arr[i];
    }

    cout << prime(arr, num) << endl;
    return 0; 
}
