def main():
    n = int(input())
    primelist = []
    for _ in range(n):
        x = int(input())
        if isprime(x) == 1:
            primelist.append(x)
    print(len(primelist))

def isprime(x: int):    
    yesno = 1
    for y in range(2, x):
        if gcd(x, y) != 1:
            yesno = 0
            break
    return yesno

def gcd(x, y):    
    # x > y となるように並べ替え
    if x < y:
        (x, y) = (y, x)
    return x if y == 0 else gcd(y, x%y)

if __name__ == '__main__':
    main()

