import sys


def isprime(n):
    '''check if integer n is a prime'''

    # make sure n is a positive integer
    n = abs(int(n))

    # 0 and 1 are not primes
    if n < 2:
        return False

    # 2 is the only even prime number
    if n == 2: 
        return True    

    # all other even numbers are not primes
    if not n & 1: 
        return False

    # range starts with 3 and only needs to go up 
    # the square root of n for all odd numbers
    for x in range(3, int(n**0.5) + 1, 2):
        if n % x == 0:
            return False

    return True


max = int(sys.stdin.readline())
answer = 0

for x in range(max):
    n = sys.stdin.readline()
    if isprime(int(n)):
        answer += 1

print(answer) import sys sys def isprime(n):
    '''check if integer n is a prime'''

    # make sure n is a positive integer
    n = abs(int(n))

    # 0 and 1 are not primes
    if n < 2:
        return False

    # 2 is the only even prime number
    if n == 2: 
        return True    

    # all other even numbers are not primes
    if not n & 1: 
        return False

    # range starts with 3 and only needs to go up 
    # the square root of n for all odd numbers
    for x in range(3, int(n**0.5) + 1, 2):
        if n % x == 0:
            return False

    return True isprime '''check if integer n is a prime''' n = abs(int(n)) n abs(int(n)) abs int(n) int n if n < 2:
        return False

    # 2 is the only even prime number
     n < 2 n 2 return False False if n == 2: 
        return True    

    # all other even numbers are not primes
     n == 2 n 2 return True True if not n & 1: 
        return False

    # range starts with 3 and only needs to go up 
    # the square root of n for all odd numbers
     not n & 1 n & 1 n 1 return False False for x in range(3, int(n**0.5) + 1, 2):
        if n % x == 0:
            return False

     x range(3, int(n**0.5) + 1, 2) range 3 int(n**0.5) + 1 int(n**0.5) int n**0.5 n 0.5 1 2 if n % x == 0:
            return False

     n % x == 0 n % x n x 0 return False False return True True n n max = int(sys.stdin.readline()) max int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline answer = 0 answer 0 for x in range(max):
    n = sys.stdin.readline()
    if isprime(int(n)):
        answer += 1 x range(max) range max n = sys.stdin.readline() n sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline if isprime(int(n)):
        answer += 1 isprime(int(n)) isprime int(n) int n answer += 1 answer 1 print(answer) print answer answer = 0 0 answer n = sys.stdin.readline() sys.stdin.readline() n max = int(sys.stdin.readline()) int(sys.stdin.readline()) max def isprime(n):
    '''check if integer n is a prime'''

    # make sure n is a positive integer
    n = abs(int(n))

    # 0 and 1 are not primes
    if n < 2:
        return False

    # 2 is the only even prime number
    if n == 2: 
        return True    

    # all other even numbers are not primes
    if not n & 1: 
        return False

    # range starts with 3 and only needs to go up 
    # the square root of n for all odd numbers
    for x in range(3, int(n**0.5) + 1, 2):
        if n % x == 0:
            return False

    return True def isprime(n):
    '''check if integer n is a prime'''

    # make sure n is a positive integer
    n = abs(int(n))

    # 0 and 1 are not primes
    if n < 2:
        return False

    # 2 is the only even prime number
    if n == 2: 
        return True    

    # all other even numbers are not primes
    if not n & 1: 
        return False

    # range starts with 3 and only needs to go up 
    # the square root of n for all odd numbers
    for x in range(3, int(n**0.5) + 1, 2):
        if n % x == 0:
            return False

    return True isprime answer += 1 1 answer
import sys


def isprime(n):
    '''check if integer n is a prime'''

    # make sure n is a positive integer
    n = abs(int(n))

    # 0 and 1 are not primes
    if n < 2:
        return False

    # 2 is the only even prime number
    if n == 2: 
        return True    

    # all other even numbers are not primes
    if not n & 1: 
        return False

    # range starts with 3 and only needs to go up 
    # the square root of n for all odd numbers
    for x in range(3, int(n**0.5) + 1, 2):
        if n % x == 0:
            return False

    return True


max = int(sys.stdin.readline())
answer = 0

for x in range(max):
    n = sys.stdin.readline()
    if isprime(int(n)):
        answer += 1

print(answer)