n = int(input()) a = map(int, input().split()) s = 0 for i in a: cnt = 0 if(i == 1): continue for j in range(2, i+1): if(i % j == 0): cnt += 1 if (cnt == 1): s += 1 print(s)