//==================================================================================================
// Name        : a.cpp
// Author      : lotus.eater086
// Copyright   : If you're reading this then this warning is for you. Every word you read of this 
//               useless fine print is another second of your life. Don't you've other things to do?
//               Is your life so empty that you honestly can't think of a better way to spend these
//               moments ? Or are you so impressed with authority that you give respect and 
//               credence to all who claim it ? Do you read everything you're supposed to read ? Do
//               you think everything you're supposed to think ? Buy what you're told you should 
//               want ? Get out of your apartment . Meet a member of the opposite sex. Stop the 
//               excessive shopping and self-improvement . Quit your boring job.
//               Start a fight. Prove you're alive. If you don't claim your humanity you'll become a
//               statistic. You've been warned !

// Description : 
// Date        : 2019-10-02
// Time        : 20:29:47
// Directory   : C:\Users\Lenovo\cpPractise\deliberatePractise\code_folder\.vscode
// FilePath    : C:\Users\Lenovo\cpPractise\deliberatePractise\code_folder\.vscode\a.cpp
//==================================================================================================
    

#include <bits/stdc++.h>
#define LL long long
#define endl "\n"

using namespace std ;
    
//
template < typename T >

inline T read( T &x )
{

    x = 0 ;

    int f = 0 ;

    char ch = getchar() ;

    while( ch < '0' || ch > '9' )  {

        f |= ( ch == '-' ) , ch = getchar() ;

    }

    while( ch >= '0' && ch <= '9' )  {

        x = ( x << 1 ) + ( x << 3 ) + ch - '0' , ch = getchar() ;

    }

    return x = f ? -x:x ;

}
//

const int sz = 1e8 + 2 ;

vector<int> status( sz/32 + 1 ) , prime ;   

bool Check(int N,int pos){return (bool)(N & (1<<pos));}

int Set(int N,int pos){	return N=N | (1<<pos);}

void bitwise_sieve( void )
{

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

        if( Check( status[i/32] , i % 32 ) == 0 )  {

            for( int j = i*i ; j <= sz ; j += 2*i )  {

                status[j/32] = Set( status[j/32] , j%32 ) ;  

            }

        }

    }

}

void linear_sieve( void )
{

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

        if( status[i] == 0 )  {

            status[i] = i ;

            prime.emplace_back( i ) ;   

        }

        for( int j = 0 ; j < prime.size() && prime[j] <= status[i] && i*prime[j] <= sz ; j++ )  {

            status[ i*prime[j] ] = prime[j] ;  

        }

    }

}

void solve( void )
{

   // linear_sieve() ;

   bitwise_sieve() ;   



    int n ;

    read( n ) ;

    int cnt = 0 , x ;

    while( n-- )  {

        read( x ) ;

        if( x == 2 )  cnt++ ;

        else if( x % 2 == 0 )  continue ;  



        else if( Check( status[x/32] , x%32 ) == 0 && ( x % 2 ) != 0 )  cnt++ ;

    }

    cout << cnt << endl ; 

}

int main( void )

{

    //ios_base::sync_with_stdio( false ) ;  cin.tie( NULL ) ;  cout.tie( NULL ) ;

  

    if( 0 )  {

        int t = 100 ;

        for( int i = 1 ; i <= t ; i++ )  solve() ;

    }

    else  {

        solve() ;

    }

    

    return 0 ;

}



Measured memory_bytes: 14796