arr = [2]
count = 0
for i in range(3, 1001):
    flag = True
    for el in arr:
        if i % el == 0:
            flag = False
            break
    if flag:
        arr.append(i)
num = int(input())
nums = map(int, input().split())
for el in nums:
    if el in arr:
        count += 1
print(count)

dc488732e361059eb5e8d5afbe344302d677bc08
<mask token>

<mask token>
for i in range(3, 1001):
    flag = True
    for el in arr:
        if i % el == 0:
            flag = False
            break
    if flag:
        arr.append(i)
<mask token>
for el in nums:
    if el in arr:
        count += 1
print(count)

arr = [2]
count = 0
for i in range(3, 1001):
    flag = True
    for el in arr:
        if i % el == 0:
            flag = False
            break
    if flag:
        arr.append(i)
num = int(input())
nums = map(int, input().split())
for el in nums:
    if el in arr:
        count += 1
print(count)
