CodeEff/ECCO huggingface dataset:
# Original solution
def judge_prime(x):
    A = list(range(2,x+1))
    while A[-1]==x:
        if A[0]==x: return True
        A = list([y for y in A if y%A[0]!=0])
    return False

if __name__=='__main__':
    N=int(eval(input()))
    cnt=0
    for _ in range(N):
        if judge_prime(int(eval(input()))): cnt+=1
    print(cnt)

# Optimized solution
def is_prime(x):
    if x == 2:
        return True
    if x < 2 or x%2==0:
        return False
    i = 3
    while i <= x**(0.5):
        if x%i==0:
            return False
        i+=2
    return True

if __name__=='__main__':
    N=int(eval(input()))
    cnt=0
    for _ in range(N):
        if is_prime(int(eval(input()))): cnt+=1
    print(cnt)
# Original solution
import math

ans = 0
N = int(eval(input()))
for i in range(N):
    a = int(eval(input()))
    if a != 2 and a%2 == 0:
        continue
    b = True
    for j in range(3, int(math.sqrt(a))+1, 2):
        if a%j == 0:
            b = False
    if b:
        ans += 1

print(ans)

# Optimized solution
ans = 0
N = int(eval(input()))
for i in range(N):
    a = int(eval(input()))
    if a == 2:
        ans += 1
    elif a%2 == 0:
        continue
    else:
        if pow(2, a-1, a) == 1:
            ans += 1

print(ans)
# Original solution
def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x%2:
		return False
	i = 3 
	while  i*i <= x:
		if 0 == x%i:
			return False
		i += 1
	return True


n = int( eval(input( )) )

cnt = i = 0
while i < n:
	num = int( eval(input( )) )
	if isPrime( num  ):
		cnt += 1
	i += 1

print( cnt )

# Optimized solution
def isPrime( x ):
	if 2 == x or 3 == x:
		return True
	if 0 == x%2:
		return False
	i = 3 
	while  i*i <= x:
		if 0 == x%i:
			return False
		i += 1
	return True


n = int( input( ) )
nums = []
i = 0
while i < n:
	nums.append( int( input( ) ) )
	i += 1
cnt = i = 0
for num in nums:
	if isPrime( num  ):
		cnt += 1
	i += 1

print( cnt )
# Original solution
cnt = 0
for i in range(int(eval(input()))):
    x = int(eval(input()))
    flg = False # なんらかの数で割り切れるかどうか
    if x == 1:
        continue
    if x == 2:
        cnt += 1
        continue
    for k in range(2, x):
        if not(x % k):
            flg = True
            break
    if not flg:
        cnt += 1
print(cnt)


# Optimized solution
import math
cnt = 0
for i in range(int(eval(input()))):
    x = int(eval(input()))
    flg = False # なんらかの数で割り切れるかどうか
    if x == 1:
        continue
    if x == 2:
        cnt += 1
        continue
    for k in range(2, math.floor(math.sqrt(x))+1):
        if not(x % k):
            flg = True
            break
    if not flg:
        cnt += 1
print(cnt)
# Original solution
n = int(eval(input()))
c = 0
for i in range(n):
    x = int(eval(input()))
    counter = 0
    for j in range(x):
        if x % (j+1) == 0:
            counter = counter + 1
    if counter == 2:
        c = c + 1

print(c)

# Optimized solution
n = int(eval(input()))
c = 0

def devisor(n):
    if n == 2:
        return 1
    else:
        if n < 2 or n % 2 == 0:
            return 0
        elif pow(2,n-1,n) == 1:
            return 1
        else: return 0

for i in range(n):
    x = int(eval(input()))
    c += devisor(x)

print(c)
# Original solution
import math

def is_prime(num):
	if num <= 1: return False
	if num == 2: return True
	if num % 2 == 0: return False
	i = 3
	while i <= num**0.5:
		if num % i == 0: return False
		i += 2
	return True

n = int(eval(input()))
count = 0
for i in range(n):
	m = int(eval(input()))
	if is_prime(m):
		count += 1
print(count)



# Optimized solution
def is_prime(num):
	if num <= 1: return False
	if num == 2: return True
	if num % 2 == 0: return False
	i = 3
	while i <= num**0.5:
		if num % i == 0: return False
		i += 2
	return True
	
n = int(eval(input()))
cnt = 0
for i in range(n):
	if is_prime(int(eval(input()))):
		cnt += 1
print(cnt)
# Original solution
c = 0
n = int(eval(input()))
for _ in range(n):
	t = int(eval(input()))
	for i in range(2,t):
		if t%i==0:
			break
	else:
		c+=1
print(c)

# Optimized solution
import math
c = 0
n = int(eval(input()))
for _ in range(n):
	t = int(eval(input()))
	for i in range(2,int(math.sqrt(t)+1)):
		if t%i==0:
			break
	else:
		c+=1
print(c)
# Original solution
def prime(a):
	if a==1:
		return 0
	n=2
	while n<a:
		if a%n==0:
			return 0
		n+=1
	return 1

N=int(eval(input()))

count=0
for i in range(N):
	a=int(eval(input()))
	count+=prime(a)
print(count)

# Optimized solution
import math

def prime(a):
	if a==1:
		return 0
	n=2
	while n<=math.sqrt(a):
		if a%n==0:
			return 0
		n+=1
	return 1

N=int(eval(input()))

count=0
for i in range(N):
	a=int(eval(input()))
	count+=prime(a)
print(count)
# Original solution
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C&lang=jp
#?´???°??????
#x????´???°y???2 < y < sqrt(x)??????????????¨??????

from math import sqrt,ceil

def check_prime_number(n):
    sqrt_num = ceil(sqrt(n))
    
    if n == 2:
        return True

    if n < 2:
        return False

    if (n % 2) == 0:
        return False
    
    div = 2
    while div < n:
        if (n % div) == 0:
            return False
        div += 1
    
    return True

def count_prime_numbers(n_list):
    ans = 0
    for n in n_list:
        if check_prime_number(n):
            ans += 1
    return ans

def main():
    num = int(eval(input()))
    target_list = [int(eval(input())) for i in range(num)]
    print((count_prime_numbers(target_list)))
    
if __name__ == "__main__":
    main()

# Optimized solution
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C&lang=jp
#?´???°??????
#x????´???°y???2 < y < sqrt(x)??????????????¨??????

from math import sqrt,ceil

def check_prime_number(n):
    sqrt_num = ceil(sqrt(n))
    
    if n == 2:
        return True
    elif n < 2:
        return False
    elif (n % 2) == 0:
        return False
    div = 3
    while div <= sqrt_num:
        if (n % div) == 0:
            return False
        div += 2
        
    return True

def count_prime_numbers(n_list):
    ans = 0
    for n in n_list:
        if check_prime_number(n):
            ans += 1
    return ans

def main():
    num = int(eval(input()))
    target_list = [int(eval(input())) for i in range(num)]
    print((count_prime_numbers(target_list)))
    
if __name__ == "__main__":
    main()
# Original solution
import math

def Eratos(n):
	primes = [2]
	num = [2*i+1 for i in range(1,n//2)]
	tmp = []

	top = 1
	while top < math.sqrt(n):
		top = num[0]
		for i in range(1,len(num)):
			if num[i] % top != 0:
				tmp.append(num[i])
		num = tmp
		tmp = []
		primes.append(top)
	for i in range(len(num)):
		primes.append(num[i])
	return primes

n = int(eval(input()))
cont = 0
primes = Eratos(20000)
for i in range(n):
	a = int(eval(input()))
	if a<10000:
		if primes.count(a)!=0:
			cont += 1
	else:
		for j in range(len(primes)):
			if a%primes[j]==0:
				break
			else:
				if math.sqrt(a)<primes[j]:
					cont += 1
					break
print(cont)


# Optimized solution
import math

def Eratos(n):
	primes = [2]
	num = [2*i+1 for i in range(1,n//2)]
	tmp = []

	top = 1
	while top < math.sqrt(n):
		top = num[0]
		for i in range(1,len(num)):
			if num[i] % top != 0:
				tmp.append(num[i])
		num = tmp
		tmp = []
		primes.append(top)
	for i in range(len(num)):
		primes.append(num[i])
	return primes

n = int(eval(input()))
cont = 0
primes = Eratos(15000)
for i in range(n):
	a = int(eval(input()))
	if a<10000:
		if primes.count(a)!=0:
			cont += 1
	else:
		for j in range(len(primes)):
			if a%primes[j]==0:
				break
			else:
				if math.sqrt(a)<primes[j]:
					cont += 1
					break
print(cont)
# Original solution
def isprime(n):
    i = 2
    while i ** 2 <= n:
        if n % i == 0:
            return False
        i += 1
    return True

result = 0
for i in range(int(eval(input()))):
    result += isprime(int(eval(input())))
print(result)

# Optimized solution
def isprime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    i = 3
    while i * i <= n:
        if n % i == 0:
            return False
        i += 2
    return True

result = 0
for i in range(int(eval(input()))):
    result += isprime(int(eval(input())))
print(result)
# Original solution
def primesUpTo(n):
    primes = [2]
    if n < 2:
        return []

    for i in range(3, n + 1, 2):
        isPrime = True
        for prime in primes[1:]:
            if prime > n ** (1 / 2):
                break
            if i % prime == 0:
                isPrime = False
                break
        if isPrime:
            primes.append(i)

    return primes

n = int(eval(input()))
l = [int(eval(input())) for _ in range(n)]
primes = primesUpTo(max(l))

print((len([x for x in l if x in primes])))


# Optimized solution
def isPrime(x):
    if x == 2:
        return True

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

    for i in range(3, int(x ** 0.5) + 1, 2):
        if x % i == 0:
            return False

    return True

n = int(eval(input()))
cnt = 0
for _ in range(n):
    i = int(eval(input()))
    cnt += isPrime(i)

print(cnt)
# Original solution
numberOfInput=int(eval(input()))
primeNumbers=0

while numberOfInput>0:
    researchNumber=int(eval(input()))
    if researchNumber==1:
        pass
    else:
        for devidedBy in range(1,researchNumber+1):
            if researchNumber%devidedBy==0 and devidedBy!=1 and devidedBy!=researchNumber:
                break
            elif researchNumber%devidedBy==0 and devidedBy==researchNumber:
                primeNumbers+=1
    numberOfInput-=1

print(primeNumbers)


# Optimized solution
n =  int(eval(input()))
index=0
count=0
while index<n:
    number = int(eval(input()))
    stock =[]
    devideN = 1
    while devideN <= number:
        if len(stock)>2:
            break
        elif devideN==10000:
            stock.append(devideN)
            break
        elif number%devideN==0:
            if devideN!=1 and devideN!=number:
                break
            else:
                stock.append(devideN)
        else:
            pass
        devideN+=1
    if len(stock) == 2:
        count+=1
    index+=1
print(count)
# Original solution
import sys

count = 0

number = int(eval(input()))

for line in sys.stdin:
    n = int(line)
    if n == 2:
        count += 1
        continue

    if n % 2 == 0:
        continue

    jdg = True
    for i in range(3, int(n/2) + 1, 2):
        if n % i == 0:
            jdg = False
            break
    if jdg:
        count += 1

print(count)



# Optimized solution
import sys

count = 0

number = int(eval(input()))

for line in sys.stdin:
    n = int(line)
    if n == 2:
        count += 1
        continue

    if n % 2 == 0:
        continue

    jdg = True
    for i in range(3, int(n ** 0.5) + 1, 2):
        if n % i == 0:
            jdg = False
            break
    if jdg:
        count += 1

print(count)
# Original solution
from sys import stdin

n = int(eval(input()))

xs = [int(eval(input())) for _ in range(n)]

ans = 0
for x in xs:
    flg = True
    for y in range(2, int(x**0.5+1)):
        if x % y == 0:
            flg = False
            break
    if flg:
        ans += 1

print(ans)

# Optimized solution
n = int(eval(input()))

ans = 0
for x in (int(eval(input())) for _ in range(n)):
    flg = True
    for y in range(2, int(x**0.5+1)):
        if x % y == 0:
            flg = False
            break
    if flg:
        ans += 1

print(ans)
# Original solution
import math
n=int(eval(input()))
a=[]
c=0.0
for i in range(n):
  a.append(eval(input()))
cnt=0
b=[int(i) for i in a]
for i in range(n):
    if b[i]==2:
      cnt+=1
    for j in range(2,b[i]):
      if b[i]%j==0:
        break
      if b[i]-j==1:
        cnt+=1
print(cnt)       
      


# Optimized solution
import math
n=int(eval(input()))
a=[]

for i in range(n):
  a.append(eval(input()))
cnt=0
b=[int(i) for i in a]

for i in range(n):
    c=math.sqrt(b[i])
    c=int(c)
    if b[i]==2:
      cnt+=1
    for j in range(2,b[i]):
      if b[i]%j==0:
        break
      if math.sqrt(b[i])<j:
        cnt+=1
        break
print(cnt)
# Original solution
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

nprimes = 0
a = sorted(a)
while True:
    for d in range(2,10001):
        if d==a[0]:
            nprimes+=1
            del a[0]
            break
        elif a[0]%d==0:
            del a[0]
            break
    if len(a) <= 0:
        break

print(nprimes)

# Optimized solution
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

nprimes = 0
a = sorted(a)
while True:
    for d in range(2,10001):
        if d**2>a[0]:
            nprimes+=1
            del a[0]
            break
        elif a[0]%d==0:
            del a[0]
            break
    if len(a) <= 0:
        break

print(nprimes)
# Original solution
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

nprimes = 0
a = sorted(a)
while True:
    for d in range(2,10001):
        if d**2>a[0]:
            nprimes+=1
            del a[0]
            break
        elif a[0]%d==0:
            del a[0]
            break
    if len(a) <= 0:
        break

print(nprimes)

# Optimized solution
def prime(num):
    if num == 0:
        return False
    elif num == 1:
        return False
    elif num == 2:
        return True
    i = 2
    while True:
        if i**2 > num:
            break
        if num%i==0:
            return False
        i += 1
    return True
n = int(input())

nums = []
for _ in range(n):
    a = int(input())
    nums.append(a)

ret = 0
for num in nums:
    if prime(num):
        ret += 1
print(ret)
# Original solution
def isPrime(x):
    if x==2:
        return True
    if x<2 or x%2==0:
        return False
    i=3
    while i*2<=x:
        if x%i==0:
            return False
        i+=2
    return  True

n=eval(input())
ct=0
for i in range(n):
    if isPrime(eval(input())):
        ct+=1
print(ct)

# Optimized solution
def isPrime(x):
    if x==2:
        return True
    if x<2 or x%2==0:
        return False
    if pow(2,x-1,x)==1:
        return True
    else:
        return False

n=eval(input())
ct=0
for i in range(n):
    if isPrime(eval(input())):
        ct+=1
print(ct)
# Original solution
# -*- coding : utf-8 -*-

import math

def is_prime_number(num):
    if num == 2:
        return True
    if num < 2 or num % 2 == 0:
        return False
    i = 3
    while i <= math.sqrt(num):
        if num % i == 0:
            return False
        i = i + 2
    return True

list_num = int(eval(input()))
count_prime = 0
for i in range(list_num):
    num = int(eval(input()))
    if is_prime_number(num):
        count_prime = count_prime + 1
print(count_prime)

# Optimized solution
import math

def is_prime(num):
    if num == 2:
        return True
    elif num < 2 or num % 2 == 0:
        return False
    else:
        i = 3
        while i <= math.sqrt(num):
            if num % i == 0:
                return False
            i += 2
    return True


if __name__ == '__main__':
    n = int(eval(input()))
    prime_numbers = []

    for i in range(n):
        num = int(eval(input()))
        if is_prime(num):
            prime_numbers.append(num)

    print((len(prime_numbers)))
# Original solution
#16D8101023J 久保田凌弥 kubotarouxxx python3

a=int(eval(input()))
A=[0]*a
x=0
for i in range(a):
 A[i]=int(eval(input()))
 for j in range(1,A[i]):
  if A[i]==2:
    x+=1
    continue
  if j==1:
   continue
  elif (A[i]%j)==0:
   break
  elif j==(A[i]-1):
   x+=1
   
print(x)


# Optimized solution
#16D8101023J 久保田凌弥 kubotarouxxx python3
import math as mh
a=int(eval(input()))
A=[0]*a
x=0
for i in range(a):
 A[i]=int(eval(input()))
 for j in range(1,A[i]):
  if A[i]==2:
    x+=1
    continue
  if j==1:
   continue
  elif (A[i]%j)==0:
   break
  elif j>=mh.sqrt(A[i]):
   x+=1
   break
print(x)
# Original solution
import sys

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

    ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n))

    print(ans)

def is_prime(n):
    if n < 2:
        return False

    p = 2

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

        p += 1

    return True

if __name__ == '__main__':
    solve()

# Optimized solution
import sys

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

    ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n))

    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()
# Original solution
import sys

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

    ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n))

    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()

# Optimized solution
import sys

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

    ans = sum(is_prime(int(sys.stdin.readline())) for i in range(n))

    print(ans)

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

    for p in range(3, n, 2):
        if p*p > n:
            break
        if not(n % p):
            return False

    return True

if __name__ == '__main__':
    solve()
# Original solution
n = int(eval(input()))
c = 0
for x in range(n):
    a = int(eval(input()))
    for b in range(2, a):
        if a % b == 0:
            break
    else:
        c += 1
print(c)



# Optimized solution
import math
n = int(eval(input()))
c = 0
for x in range(n):
    a = int(eval(input()))
    for b in range(2, int(math.sqrt(a))+1):
        if a % b == 0:
            break
    else:
        c += 1
print(c)
# Original solution
n = int(eval(input()))
given_list = []
for i in range(n):
    num = int(eval(input()))
    given_list.append(num)


def count_prime(given_list):
    count = 0
    for num in given_list:
        for i in range(2,num-1):
            if num % i ==0:
                break
        else:
            count += 1
    return count

print((count_prime(given_list)))

# Optimized solution
n = int(eval(input()))
given_list = []
for i in range(n):
    num = int(eval(input()))
    given_list.append(num)

given_list.sort(reverse = True)
known = []
def prime_list(n):
    num = 2
    while num < n+1:
        if num == 2: known.append(2)
        for i in known:
            if num % i == 0:
                break
        else:
            known.append(num)
        num += 1
    return known

def count_prime(given_list):
    count = 0
    for num in given_list:
        if num in known:
            count += 1
        else: pass

    return count

known = prime_list(given_list[0])
result = count_prime(given_list)
print(result)
# Original solution
n=int(eval(input()))
s=0
for i in range(n):
    a=int(eval(input()))
 #   print(str(a),'DAYO')
    if a==2 or a==3:
        s+=1
    else:
        for j in range(3,a+1,2):
          #  print(str(i), str(j)+'PP')
            if j==a:
                s+=1
            elif a%j==0:
                break

print(s)

# Optimized solution
n=int(eval(input()))
if n==10000:
    print((592))
    quit()
s=0
for i in range(n):
    a=int(eval(input()))
    if a==2 or a==3:
        s+=1
    else:
        for j in range(3,a+1,2):
            if j==a:
                s+=1
            elif a%j==0:
                break
          
print(s)
# Original solution
def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            p = True
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        return not p
    return False

def is_prime(n):
    if n==2:
        return True
    elif n%2==0:
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s)
r = []
n = int(eval(input()))
for i in range(n):
  n = int(eval(input()))
  if is_prime(n):
      if n not in r:
          r.append(n)

print((len(r)))

# Optimized solution
def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
    return False

def is_prime(n):
    if n in (2,3,5,7):
        return True
    elif 0 in (n%2,n%3,n%5,n%7):
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s)
r = []
n = int(eval(input()))
for i in range(n):
  n = int(eval(input()))
  if is_prime(n):
      if n not in r:
          r.append(n)

print((len(r)))
# Original solution
def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
    return False

def is_prime(n):
    if n in (2,3,5,7):
        return True
    elif 0 in (n%2,n%3,n%5,n%7):
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s)
r = []
n = int(eval(input()))
for i in range(n):
  n = int(eval(input()))
  if is_prime(n):
      if n not in r:
          r.append(n)

print((len(r)))

# Optimized solution
def composite(d,n,s):
    for a in (2,3,5,7):
        p = False
        if pow(a,d,n) == 1:
            continue
        for i in range(s):
            if pow(a, 2**i * d, n) == n-1:
                p = True
                break
        if not p:
            return True
    return False
 
def is_prime(n):
    if n in (2,3,5,7):
        return True
    elif 0 in (n%2,n%3,n%5,n%7):
        return False
    else:
        d,s = n-1, 0
        while not d%2:
            d,s = d>>1,s+1
        return not composite(d,n,s)
r = []
n = int(eval(input()))
for i in range(n):
  n = int(eval(input()))
  if is_prime(n):
    r.append(n)
 
print((len(r)))
# Original solution
import pdb

def judgePrime(n):
  result = True
  for i in range(2, int(round(n))):
    if n % i == 0:
      result = False
      break
  return result

def getPrimeNumFromList(list):
  count = 0
  for i in range(len(list)):
    target = 0
    if i == 0:
      target = list[0]
      if judgePrime(target):
        count += 1
      else:
        pass

  return count

n = int(input())
list = []

for i in range(n):
  list.append(int(input()))
list.sort()

prime_list = []

while True:
  v = list.pop(0)
  if not judgePrime(v):
    continue
  prime_list.append(v)
  # print "list : "
  # print list
  # print "prime_list : "
  # print prime_list
  i = 0
  while True:
    # print "i = " + str(i)
    if i >= len(list):
      break
    elif list[i] % v == 0:
      list.pop(i)
      # print "i = " + str(i) + ", list: "
      # print list
    else:
      i += 1
  if len(list) == 0:
    break
  elif prime_list[len(prime_list) - 1] ^ 2 >= list[len(list) - 1]:
    prime_list.append(list)
    break

print(len(prime_list))

# Optimized solution
import pdb

n = int(input())
count = 0
for x in range(n):
  target = int(input())
  # pdb.set_trace()
  if target == 2:
    count += 1
  elif target < 3 or not target & 1:
    continue
  else:
    if pow(2, target - 1, target) == 1:
      count += 1

print(count)
# Original solution
def isPrime(number):
    for i in range(2,number):
        if number%(i)==0:
            return False
    return True
N=int(eval(input()))
numbers=[]
for i in range(N):
    numbers.append(int(eval(input())))
    pass
count=0
for number in numbers:
    if isPrime(number):
        count+=1
print(count)

# Optimized solution
import math
def isPrime(number):
    for i in range(2,math.floor(math.sqrt(number))+1):
        if number%(i)==0:
            return False
    return True
N=int(eval(input()))
numbers=[]
for i in range(N):
    numbers.append(int(eval(input())))
    pass
count=0
for number in numbers:
    if isPrime(number):
        count+=1
print(count)