def main():
    n = int(input())
    count = 0
    for _ in range(n):
        x = int(input())
        if isprime(x) == 1:
            count += 1
    print(count)

def isprime(x: int):    
    if x == 2:
        return 1
    elif x % 2 == 0:
        return 0
    else:        
        for y in range(3, x, 2):
            # 偶数は最初に除外するので、奇数で割れるかだけ見ていく
            if x % y == 0:
                return 0
    return 1

if __name__ == '__main__':
    main()

