def main():
    N = int(input())
    print(IsPrime(N))

def IsPrime(N):
    count = 0
    for i in range(N):
        inputNum = int(input())
        if(inputNum == 2):
            count += 1
            continue
        elif(inputNum % 2 == 0):
            continue

        flag = 0
        for j in range(3, int(pow(inputNum, 1/2))+1):
            if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
        if(flag == 0):
            count += 1
    
    return count

if __name__ == '__main__':
    main() def main():
    N = int(input())
    print(IsPrime(N)) main N = int(input()) N int(input()) int input() input print(IsPrime(N)) print IsPrime(N) IsPrime N def IsPrime(N):
    count = 0
    for i in range(N):
        inputNum = int(input())
        if(inputNum == 2):
            count += 1
            continue
        elif(inputNum % 2 == 0):
            continue

        flag = 0
        for j in range(3, int(pow(inputNum, 1/2))+1):
            if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
        if(flag == 0):
            count += 1
    
    return count IsPrime count = 0 count 0 for i in range(N):
        inputNum = int(input())
        if(inputNum == 2):
            count += 1
            continue
        elif(inputNum % 2 == 0):
            continue

        flag = 0
        for j in range(3, int(pow(inputNum, 1/2))+1):
            if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
        if(flag == 0):
            count += 1
    
     i range(N) range N inputNum = int(input()) inputNum int(input()) int input() input if(inputNum == 2):
            count += 1
            continue
        elif(inputNum % 2 == 0):
            continue

         inputNum == 2 inputNum 2 count += 1 count 1 continue elif(inputNum % 2 == 0):
            continue

         inputNum % 2 == 0 inputNum % 2 inputNum 2 0 continue flag = 0 flag 0 for j in range(3, int(pow(inputNum, 1/2))+1):
            if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
         j range(3, int(pow(inputNum, 1/2))+1) range 3 int(pow(inputNum, 1/2))+1 int(pow(inputNum, 1/2)) int pow(inputNum, 1/2) pow inputNum 1/2 1 2 1 if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
         inputNum % j == 0 inputNum % j inputNum j 0 flag = 1 flag 1 break continue if(flag == 0):
            count += 1
    
     flag == 0 flag 0 count += 1 count 1 return count count N N if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = int(input())
    print(IsPrime(N)) def main():
    N = int(input())
    print(IsPrime(N)) main def IsPrime(N):
    count = 0
    for i in range(N):
        inputNum = int(input())
        if(inputNum == 2):
            count += 1
            continue
        elif(inputNum % 2 == 0):
            continue

        flag = 0
        for j in range(3, int(pow(inputNum, 1/2))+1):
            if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
        if(flag == 0):
            count += 1
    
    return count def IsPrime(N):
    count = 0
    for i in range(N):
        inputNum = int(input())
        if(inputNum == 2):
            count += 1
            continue
        elif(inputNum % 2 == 0):
            continue

        flag = 0
        for j in range(3, int(pow(inputNum, 1/2))+1):
            if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
        if(flag == 0):
            count += 1
    
    return count IsPrime
def main():
    N = int(input())
    print(IsPrime(N))

def IsPrime(N):
    count = 0
    for i in range(N):
        inputNum = int(input())
        if(inputNum == 2):
            count += 1
            continue
        elif(inputNum % 2 == 0):
            continue

        flag = 0
        for j in range(3, int(pow(inputNum, 1/2))+1):
            if(inputNum % j == 0):
                flag = 1
                break
            else:
                continue
        if(flag == 0):
            count += 1
    
    return count

if __name__ == '__main__':
    main()