import math
n = int(raw_input())
N = [int(raw_input()) for _ in xrange(n)]

def isPrime(x):
    if x == 2:
        return True

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

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

    return True

def main():
    cnt = 0
    for x in N:
        if isPrime(x):
            cnt += 1
    print cnt
    return 0

main() import math math n = int(raw_input()) n int(raw_input()) int raw_input() raw_input int(raw_input()) for _ in xrange(n) for _ in xrange(n) _ xrange(n) xrange n for _ in xrange(n) int(raw_input()) int raw_input() raw_input N = [int(raw_input()) for _ in xrange(n)] N [int(raw_input()) for _ in xrange(n)] def isPrime(x):
    if x == 2:
        return True

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

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

    return True isPrime if x == 2:
        return True

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

     x < 2 or x % 2 == 0 x < 2 x 2 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 main():
    cnt = 0
    for x in N:
        if isPrime(x):
            cnt += 1
    print cnt
    return 0 main cnt = 0 cnt 0 for x in N:
        if isPrime(x):
            cnt += 1
     x N if isPrime(x):
            cnt += 1
     isPrime(x) isPrime x cnt += 1 cnt 1 print return 0 0 main() main N = [int(raw_input()) for _ in xrange(n)] [int(raw_input()) for _ in xrange(n)] N def main():
    cnt = 0
    for x in N:
        if isPrime(x):
            cnt += 1
    print cnt
    return 0 def main():
    cnt = 0
    for x in N:
        if isPrime(x):
            cnt += 1
    print cnt
    return 0 main def isPrime(x):
    if x == 2:
        return True

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

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

    return True def isPrime(x):
    if x == 2:
        return True

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

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

    return True isPrime n = int(raw_input()) int(raw_input()) n
import math
n = int(raw_input())
N = [int(raw_input()) for _ in xrange(n)]

def isPrime(x):
    if x == 2:
        return True

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

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

    return True

def main():
    cnt = 0
    for x in N:
        if isPrime(x):
            cnt += 1
    print cnt
    return 0

main()