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)

    print(sum(map(isPrime, nums)))


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)

    print(sum(map(isPrime, nums))) 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 print(sum(map(isPrime, nums))) print sum(map(isPrime, nums)) sum map(isPrime, nums) map isPrime nums if __name__ == '__main__' :
    main() __name__ == '__main__' __name__ '__main__' main() main def main() :
    n = int(input())
    nums = []
    for i in range(n) :
        x = int(input())
        nums.append(x)

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

    print(sum(map(isPrime, nums))) 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
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)

    print(sum(map(isPrime, nums)))


if __name__ == '__main__' :
    main()