#!/usr/bin/env python
# -*- coding: utf-8 -*-


"""
input:
11
7
8
9
10
11
12
13
14
15
16
17

output:
4
"""

import sys


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

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


def solve(_c_list):
    cnt = 0
    for ele in _c_list:
        if is_prime(ele):
            cnt += 1
    return cnt


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    c_num = int(_input[0])
    c_list = list(map(int, _input[1:]))
    ans = solve(c_list)
    print(ans) """
input:
11
7
8
9
10
11
12
13
14
15
16
17

output:
4
""" import sys sys def is_prime(x):
    if x == 2:
        return True
    elif x < 2 or not x % 2:
        return False

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

     x == 2 x 2 return True True elif x < 2 or not x % 2:
        return False

     x < 2 or not x % 2 x < 2 x 2 not x % 2 x % 2 x 2 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 solve(_c_list):
    cnt = 0
    for ele in _c_list:
        if is_prime(ele):
            cnt += 1
    return cnt solve cnt = 0 cnt 0 for ele in _c_list:
        if is_prime(ele):
            cnt += 1
     ele _c_list if is_prime(ele):
            cnt += 1
     is_prime(ele) is_prime ele cnt += 1 cnt 1 return cnt cnt _c_list _c_list if __name__ == '__main__':
    _input = sys.stdin.readlines()
    c_num = int(_input[0])
    c_list = list(map(int, _input[1:]))
    ans = solve(c_list)
    print(ans) __name__ == '__main__' __name__ '__main__' _input = sys.stdin.readlines() _input sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines c_num = int(_input[0]) c_num int(_input[0]) int _input[0] _input 0 c_list = list(map(int, _input[1:])) c_list list(map(int, _input[1:])) list map(int, _input[1:]) map int _input[1:] _input 1: 1 ans = solve(c_list) ans solve(c_list) solve c_list print(ans) print ans _input = sys.stdin.readlines() sys.stdin.readlines() _input def solve(_c_list):
    cnt = 0
    for ele in _c_list:
        if is_prime(ele):
            cnt += 1
    return cnt def solve(_c_list):
    cnt = 0
    for ele in _c_list:
        if is_prime(ele):
            cnt += 1
    return cnt solve c_num = int(_input[0]) int(_input[0]) c_num c_list = list(map(int, _input[1:])) list(map(int, _input[1:])) c_list ans = solve(c_list) solve(c_list) ans def is_prime(x):
    if x == 2:
        return True
    elif x < 2 or not x % 2:
        return False

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

    return pow(2, x - 1, x) == 1 is_prime
#!/usr/bin/env python
# -*- coding: utf-8 -*-


"""
input:
11
7
8
9
10
11
12
13
14
15
16
17

output:
4
"""

import sys


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

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


def solve(_c_list):
    cnt = 0
    for ele in _c_list:
        if is_prime(ele):
            cnt += 1
    return cnt


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    c_num = int(_input[0])
    c_list = list(map(int, _input[1:]))
    ans = solve(c_list)
    print(ans)