import math

def isPrime(x) :
    if x == 2 :
        return True

    if x < 2 or x % 2 == 0 :
        return False

    i = 3
    while i <= math.sqrt(x) :
        if x % i == 0 :
            return False
        i += 2

    return True


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

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

    print(count)


if __name__ == '__main__' :
    main() import math math def isPrime(x) :
    if x == 2 :
        return True

    if x < 2 or x % 2 == 0 :
        return False

    i = 3
    while i <= math.sqrt(x) :
        if x % i == 0 :
            return False
        i += 2

    return True isPrime 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 i = 3 i 3 while i <= math.sqrt(x) :
        if x % i == 0 :
            return False
        i += 2

     i <= math.sqrt(x) i math.sqrt(x) math.sqrt math sqrt x if x % i == 0 :
            return False
         x % i == 0 x % i x i 0 return False False i += 2 i 2 return True True x x def main() :
    n = int(input())
    nums = []
    for i in range(n) :
        x = int(input())
        nums.append(x)

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

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

     i 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 isPrime(num) :
            count += 1

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

     isPrime(num) isPrime num count += 1 count 1 print(count) print count if __name__ == '__main__' :
    main() __name__ == '__main__' __name__ '__main__' main() main def isPrime(x) :
    if x == 2 :
        return True

    if x < 2 or x % 2 == 0 :
        return False

    i = 3
    while i <= math.sqrt(x) :
        if x % i == 0 :
            return False
        i += 2

    return True def isPrime(x) :
    if x == 2 :
        return True

    if x < 2 or x % 2 == 0 :
        return False

    i = 3
    while i <= math.sqrt(x) :
        if x % i == 0 :
            return False
        i += 2

    return True isPrime def main() :
    n = int(input())
    nums = []
    for i in range(n) :
        x = int(input())
        nums.append(x)

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

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

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

    print(count) main
import math

def isPrime(x) :
    if x == 2 :
        return True

    if x < 2 or x % 2 == 0 :
        return False

    i = 3
    while i <= math.sqrt(x) :
        if x % i == 0 :
            return False
        i += 2

    return True


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

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

    print(count)


if __name__ == '__main__' :
    main()