import sys

def solve():
    n = int(sys.stdin.readline())
    ans = 0

    for i in range(n):
        num = int(sys.stdin.readline())

        ans += is_prime(num)

    print(ans)

def is_prime(n):
    if n < 2 or (n > 2 and n & 1 == 0):
        return False

    p = 3

    while p*p <= n:
        if n % p == 0:
            return False

        p += 2

    return True

if __name__ == '__main__':
    solve() import sys sys def solve():
    n = int(sys.stdin.readline())
    ans = 0

    for i in range(n):
        num = int(sys.stdin.readline())

        ans += is_prime(num)

    print(ans) solve n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline ans = 0 ans 0 for i in range(n):
        num = int(sys.stdin.readline())

        ans += is_prime(num)

     i range(n) range n num = int(sys.stdin.readline()) num int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline ans += is_prime(num) ans is_prime(num) is_prime num print(ans) print ans def is_prime(n):
    if n < 2 or (n > 2 and n & 1 == 0):
        return False

    p = 3

    while p*p <= n:
        if n % p == 0:
            return False

        p += 2

    return True is_prime if n < 2 or (n > 2 and n & 1 == 0):
        return False

     n < 2 or (n > 2 and n & 1 == 0) n < 2 n 2 n > 2 and n & 1 == 0 n > 2 n 2 n & 1 == 0 n & 1 n 1 0 return False False p = 3 p 3 while p*p <= n:
        if n % p == 0:
            return False

        p += 2

     p*p <= n p*p p p n if n % p == 0:
            return False

         n % p == 0 n % p n p 0 return False False p += 2 p 2 return True True n n if __name__ == '__main__':
    solve() __name__ == '__main__' __name__ '__main__' solve() solve def solve():
    n = int(sys.stdin.readline())
    ans = 0

    for i in range(n):
        num = int(sys.stdin.readline())

        ans += is_prime(num)

    print(ans) def solve():
    n = int(sys.stdin.readline())
    ans = 0

    for i in range(n):
        num = int(sys.stdin.readline())

        ans += is_prime(num)

    print(ans) solve def is_prime(n):
    if n < 2 or (n > 2 and n & 1 == 0):
        return False

    p = 3

    while p*p <= n:
        if n % p == 0:
            return False

        p += 2

    return True def is_prime(n):
    if n < 2 or (n > 2 and n & 1 == 0):
        return False

    p = 3

    while p*p <= n:
        if n % p == 0:
            return False

        p += 2

    return True is_prime
import sys

def solve():
    n = int(sys.stdin.readline())
    ans = 0

    for i in range(n):
        num = int(sys.stdin.readline())

        ans += is_prime(num)

    print(ans)

def is_prime(n):
    if n < 2 or (n > 2 and n & 1 == 0):
        return False

    p = 3

    while p*p <= n:
        if n % p == 0:
            return False

        p += 2

    return True

if __name__ == '__main__':
    solve()