def is_prime(x) :
    if x == 2 :
        return True
    if x < 2 or x % 2 == 0 :
        return False

    return pow(2, x-1, x) == 1

def main() :
    n = int(input())
    nums = []
    for _ in range(n) :
        x = int(input())
        nums.append(x)

    count = 0
    for num in nums :
        if is_prime(num) :
            count += 1

    print(count)

if __name__ == '__main__' :
    main() def is_prime(x) :
    if x == 2 :
        return True
    if x < 2 or x % 2 == 0 :
        return False

    return pow(2, x-1, x) == 1 is_prime if x == 2 :
        return True
     x == 2 x 2 return True True if x < 2 or x % 2 == 0 :
        return False

     x < 2 or x % 2 == 0 x < 2 x 2 x % 2 == 0 x % 2 x 2 0 return False False return pow(2, x-1, x) == 1 pow(2, x-1, x) == 1 pow(2, x-1, x) pow 2 x-1 x 1 x 1 x x def main() :
    n = int(input())
    nums = []
    for _ in range(n) :
        x = int(input())
        nums.append(x)

    count = 0
    for num in nums :
        if is_prime(num) :
            count += 1

    print(count) main n = int(input()) n int(input()) int input() input nums = [] nums [] for _ in range(n) :
        x = int(input())
        nums.append(x)

     _ range(n) range n x = int(input()) x int(input()) int input() input nums.append(x) nums.append nums append x count = 0 count 0 for num in nums :
        if is_prime(num) :
            count += 1

     num nums if is_prime(num) :
            count += 1

     is_prime(num) is_prime num count += 1 count 1 print(count) print count if __name__ == '__main__' :
    main() __name__ == '__main__' __name__ '__main__' main() main def main() :
    n = int(input())
    nums = []
    for _ in range(n) :
        x = int(input())
        nums.append(x)

    count = 0
    for num in nums :
        if is_prime(num) :
            count += 1

    print(count) def main() :
    n = int(input())
    nums = []
    for _ in range(n) :
        x = int(input())
        nums.append(x)

    count = 0
    for num in nums :
        if is_prime(num) :
            count += 1

    print(count) main def is_prime(x) :
    if x == 2 :
        return True
    if x < 2 or x % 2 == 0 :
        return False

    return pow(2, x-1, x) == 1 def is_prime(x) :
    if x == 2 :
        return True
    if x < 2 or x % 2 == 0 :
        return False

    return pow(2, x-1, x) == 1 is_prime
def is_prime(x) :
    if x == 2 :
        return True
    if x < 2 or x % 2 == 0 :
        return False

    return pow(2, x-1, x) == 1

def main() :
    n = int(input())
    nums = []
    for _ in range(n) :
        x = int(input())
        nums.append(x)

    count = 0
    for num in nums :
        if is_prime(num) :
            count += 1

    print(count)

if __name__ == '__main__' :
    main()