#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C&lang=jp
#?´???°??????
#x????´???°y???2 < y < sqrt(x)??????????????¨??????

from math import sqrt,ceil

def check_prime_number(n):
    sqrt_num = ceil(sqrt(n))
    
    if n == 2:
        return True
    elif n < 2:
        return False
    elif (n % 2) == 0:
        return False
    div = 3
    while div <= sqrt_num:
        if (n % div) == 0:
            return False
        div += 2
        
    return True

def count_prime_numbers(n_list):
    ans = 0
    for n in n_list:
        if check_prime_number(n):
            ans += 1
    return ans

def main():
    num = int(input())
    target_list = [int(input()) for i in range(num)]
    print(count_prime_numbers(target_list))
    
if __name__ == "__main__":
    main() from math import sqrt,ceil def check_prime_number(n):
    sqrt_num = ceil(sqrt(n))
    
    if n == 2:
        return True
    elif n < 2:
        return False
    elif (n % 2) == 0:
        return False
    div = 3
    while div <= sqrt_num:
        if (n % div) == 0:
            return False
        div += 2
        
    return True check_prime_number sqrt_num = ceil(sqrt(n)) sqrt_num ceil(sqrt(n)) ceil sqrt(n) sqrt n if n == 2:
        return True
    elif n < 2:
        return False
    elif (n % 2) == 0:
        return False
     n == 2 n 2 return True True elif n < 2:
        return False
     n < 2 n 2 return False False elif (n % 2) == 0:
        return False
     (n % 2) == 0 n % 2 n 2 0 return False False div = 3 div 3 while div <= sqrt_num:
        if (n % div) == 0:
            return False
        div += 2
        
     div <= sqrt_num div sqrt_num if (n % div) == 0:
            return False
         (n % div) == 0 n % div n div 0 return False False div += 2 div 2 return True True n n def count_prime_numbers(n_list):
    ans = 0
    for n in n_list:
        if check_prime_number(n):
            ans += 1
    return ans count_prime_numbers ans = 0 ans 0 for n in n_list:
        if check_prime_number(n):
            ans += 1
     n n_list if check_prime_number(n):
            ans += 1
     check_prime_number(n) check_prime_number n ans += 1 ans 1 return ans ans n_list n_list def main():
    num = int(input())
    target_list = [int(input()) for i in range(num)]
    print(count_prime_numbers(target_list))
     main num = int(input()) num int(input()) int input() input int(input()) for i in range(num) for i in range(num) i range(num) range num for i in range(num) int(input()) int input() input target_list = [int(input()) for i in range(num)] target_list [int(input()) for i in range(num)] print(count_prime_numbers(target_list)) print count_prime_numbers(target_list) count_prime_numbers target_list if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def count_prime_numbers(n_list):
    ans = 0
    for n in n_list:
        if check_prime_number(n):
            ans += 1
    return ans def count_prime_numbers(n_list):
    ans = 0
    for n in n_list:
        if check_prime_number(n):
            ans += 1
    return ans count_prime_numbers def main():
    num = int(input())
    target_list = [int(input()) for i in range(num)]
    print(count_prime_numbers(target_list))
     def main():
    num = int(input())
    target_list = [int(input()) for i in range(num)]
    print(count_prime_numbers(target_list))
     main def check_prime_number(n):
    sqrt_num = ceil(sqrt(n))
    
    if n == 2:
        return True
    elif n < 2:
        return False
    elif (n % 2) == 0:
        return False
    div = 3
    while div <= sqrt_num:
        if (n % div) == 0:
            return False
        div += 2
        
    return True def check_prime_number(n):
    sqrt_num = ceil(sqrt(n))
    
    if n == 2:
        return True
    elif n < 2:
        return False
    elif (n % 2) == 0:
        return False
    div = 3
    while div <= sqrt_num:
        if (n % div) == 0:
            return False
        div += 2
        
    return True check_prime_number
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C&lang=jp
#?´???°??????
#x????´???°y???2 < y < sqrt(x)??????????????¨??????

from math import sqrt,ceil

def check_prime_number(n):
    sqrt_num = ceil(sqrt(n))
    
    if n == 2:
        return True
    elif n < 2:
        return False
    elif (n % 2) == 0:
        return False
    div = 3
    while div <= sqrt_num:
        if (n % div) == 0:
            return False
        div += 2
        
    return True

def count_prime_numbers(n_list):
    ans = 0
    for n in n_list:
        if check_prime_number(n):
            ans += 1
    return ans

def main():
    num = int(input())
    target_list = [int(input()) for i in range(num)]
    print(count_prime_numbers(target_list))
    
if __name__ == "__main__":
    main()