def main():
    n = int(input())
    
    A = []
    for _ in range(n):
        A.append(int(input()))
    mx = max(A)

    Pn = [2]   #Prime numbers
    for x in range(3, mx + 1, 2):
        c1 = 0
        for y in range(len(Pn)):
            if x % Pn[y] == 0:
                c1 = 1
                break
        if c1 == 0:
            Pn.append(x)

    c2 = 0
    for a in A:
        if a in Pn:
            c2 += 1

    print(c2)
    

if __name__ == "__main__":
    main()