import java.io.*;
 
class Main {
    public static void main(String[] args) {
        BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        try {
            int n = Integer.parseInt( kb.readLine() );
            
            int num, cnt = 0;
            int i, j;
            boolean isprime = true;
            for( i=0; i<n; i++ ) {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            }
            
            System.out.println( cnt  );
             
            kb.close();
        } catch( IOException e ) {
            System.err.println( e );
        }
    }
} import java.io.*; io.* java class Main {
    public static void main(String[] args) {
        BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        try {
            int n = Integer.parseInt( kb.readLine() );
            
            int num, cnt = 0;
            int i, j;
            boolean isprime = true;
            for( i=0; i<n; i++ ) {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            }
            
            System.out.println( cnt  );
             
            kb.close();
        } catch( IOException e ) {
            System.err.println( e );
        }
    }
} Main public static void main(String[] args) {
        BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        try {
            int n = Integer.parseInt( kb.readLine() );
            
            int num, cnt = 0;
            int i, j;
            boolean isprime = true;
            for( i=0; i<n; i++ ) {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            }
            
            System.out.println( cnt  );
             
            kb.close();
        } catch( IOException e ) {
            System.err.println( e );
        }
    } main {
        BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        try {
            int n = Integer.parseInt( kb.readLine() );
            
            int num, cnt = 0;
            int i, j;
            boolean isprime = true;
            for( i=0; i<n; i++ ) {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            }
            
            System.out.println( cnt  );
             
            kb.close();
        } catch( IOException e ) {
            System.err.println( e );
        }
    } BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) ); kb new BufferedReader( new InputStreamReader( System.in ) ) try {
            int n = Integer.parseInt( kb.readLine() );
            
            int num, cnt = 0;
            int i, j;
            boolean isprime = true;
            for( i=0; i<n; i++ ) {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            }
            
            System.out.println( cnt  );
             
            kb.close();
        } catch( IOException e ) {
            System.err.println( e );
        } catch( IOException e ) {
            System.err.println( e );
        } IOException e {
            System.err.println( e );
        } System.err.println( e ) System.err.println System.err System System.err e {
            int n = Integer.parseInt( kb.readLine() );
            
            int num, cnt = 0;
            int i, j;
            boolean isprime = true;
            for( i=0; i<n; i++ ) {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            }
            
            System.out.println( cnt  );
             
            kb.close();
        } int n = Integer.parseInt( kb.readLine() ); n Integer.parseInt( kb.readLine() ) Integer.parseInt Integer kb.readLine() kb.readLine kb int num num cnt = 0; cnt 0 int i i j; j boolean isprime = true; isprime true for( i=0; i<n; i++ ) {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            } i=0; i=0 i 0 i<n i n i++ i++ i {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            } {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            } isprime = true isprime true num = Integer.parseInt( kb.readLine() ) num Integer.parseInt( kb.readLine() ) Integer.parseInt Integer kb.readLine() kb.readLine kb for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	} j=2; j=2 j 2 j<=(num/j) j (num/j) num j j++ j++ j {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	} {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	} if( 0 == num%j ) {
            			isprime = false;
            			break;
            		} 0 == num%j 0 num%j num j {
            			isprime = false;
            			break;
            		} isprime = false isprime false break; if( isprime ) {
            		cnt++;
            	} isprime {
            		cnt++;
            	} cnt++ cnt System.out.println( cnt  ) System.out.println System.out System System.out cnt kb.close() kb.close kb String[] args args
import java.io.*;
 
class Main {
    public static void main(String[] args) {
        BufferedReader kb = new BufferedReader( new InputStreamReader( System.in ) );
        try {
            int n = Integer.parseInt( kb.readLine() );
            
            int num, cnt = 0;
            int i, j;
            boolean isprime = true;
            for( i=0; i<n; i++ ) {
            	isprime = true;
            	num = Integer.parseInt( kb.readLine() );
            	for( j=2; j<=(num/j); j++ ) {
            		if( 0 == num%j ) {
            			isprime = false;
            			break;
            		}
            	}
            	if( isprime ) {
            		cnt++;
            	}
            }
            
            System.out.println( cnt  );
             
            kb.close();
        } catch( IOException e ) {
            System.err.println( e );
        }
    }
}