import sys
import math

if __name__ == "__main__":
    num = int(sys.stdin.readline().strip())
    ans = 0
    for i in range(0, num):
        n = int(sys.stdin.readline().strip())
        flag = False
        for j in range(2, int(math.sqrt(n)) + 1):
            if n % j == 0:
                flag = True
                break
        if not flag:
            ans += 1
    print ans import sys sys import math math if __name__ == "__main__":
    num = int(sys.stdin.readline().strip())
    ans = 0
    for i in range(0, num):
        n = int(sys.stdin.readline().strip())
        flag = False
        for j in range(2, int(math.sqrt(n)) + 1):
            if n % j == 0:
                flag = True
                break
        if not flag:
            ans += 1
    print ans __name__ == "__main__" __name__ "__main__" num = int(sys.stdin.readline().strip()) num int(sys.stdin.readline().strip()) int sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip ans = 0 ans 0 for i in range(0, num):
        n = int(sys.stdin.readline().strip())
        flag = False
        for j in range(2, int(math.sqrt(n)) + 1):
            if n % j == 0:
                flag = True
                break
        if not flag:
            ans += 1
     i range(0, num) range 0 num n = int(sys.stdin.readline().strip()) n int(sys.stdin.readline().strip()) int sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip flag = False flag False for j in range(2, int(math.sqrt(n)) + 1):
            if n % j == 0:
                flag = True
                break
         j range(2, int(math.sqrt(n)) + 1) range 2 int(math.sqrt(n)) + 1 int(math.sqrt(n)) int math.sqrt(n) math.sqrt math sqrt n 1 if n % j == 0:
                flag = True
                break
         n % j == 0 n % j n j 0 flag = True flag True break if not flag:
            ans += 1
     not flag flag ans += 1 ans 1 print flag = False False flag n = int(sys.stdin.readline().strip()) int(sys.stdin.readline().strip()) n flag = True True flag ans = 0 0 ans num = int(sys.stdin.readline().strip()) int(sys.stdin.readline().strip()) num ans += 1 1 ans
import sys
import math

if __name__ == "__main__":
    num = int(sys.stdin.readline().strip())
    ans = 0
    for i in range(0, num):
        n = int(sys.stdin.readline().strip())
        flag = False
        for j in range(2, int(math.sqrt(n)) + 1):
            if n % j == 0:
                flag = True
                break
        if not flag:
            ans += 1
    print ans