# -*- coding: utf-8 -*-

import math


def is_prime(x):
    # Primality Test
    if x == 2:
        return True

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

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


def to_int(v):
    return int(v)


if __name__ == '__main__':
    l = to_int(input())
    seq = [to_int(input()) for i in range(l)]
    cnt = 0

    for v in seq:
        if is_prime(v):
            cnt += 1
    print(cnt) import math math def is_prime(x):
    # Primality Test
    if x == 2:
        return True

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

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

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

     x <= 1 or x % 2 == 0 x <= 1 x 1 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 to_int(v):
    return int(v) to_int return int(v) int(v) int v v v if __name__ == '__main__':
    l = to_int(input())
    seq = [to_int(input()) for i in range(l)]
    cnt = 0

    for v in seq:
        if is_prime(v):
            cnt += 1
    print(cnt) __name__ == '__main__' __name__ '__main__' l = to_int(input()) l to_int(input()) to_int input() input to_int(input()) for i in range(l) for i in range(l) i range(l) range l for i in range(l) to_int(input()) to_int input() input seq = [to_int(input()) for i in range(l)] seq [to_int(input()) for i in range(l)] cnt = 0 cnt 0 for v in seq:
        if is_prime(v):
            cnt += 1
     v seq if is_prime(v):
            cnt += 1
     is_prime(v) is_prime v cnt += 1 cnt 1 print(cnt) print cnt def is_prime(x):
    # Primality Test
    if x == 2:
        return True

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

    i = 3
    while i <= math.sqrt(x):
        if x % i == 0:
            return False
        i += 2
    return True def is_prime(x):
    # Primality Test
    if x == 2:
        return True

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

    i = 3
    while i <= math.sqrt(x):
        if x % i == 0:
            return False
        i += 2
    return True is_prime l = to_int(input()) to_int(input()) l cnt += 1 1 cnt def to_int(v):
    return int(v) def to_int(v):
    return int(v) to_int seq = [to_int(input()) for i in range(l)] [to_int(input()) for i in range(l)] seq cnt = 0 0 cnt
# -*- coding: utf-8 -*-

import math


def is_prime(x):
    # Primality Test
    if x == 2:
        return True

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

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


def to_int(v):
    return int(v)


if __name__ == '__main__':
    l = to_int(input())
    seq = [to_int(input()) for i in range(l)]
    cnt = 0

    for v in seq:
        if is_prime(v):
            cnt += 1
    print(cnt)