
def is_prime(x):
    if x == 2:
        return True
    else:
        if 2 ** (x-1) % x == 1:
            return True
        else:
            return False

def main():
    n = int(input())
    cnt = 0
    for _ in range(n):
        if is_prime(int(input())):
            cnt += 1

    print(cnt)

main()
