# -*- coding:utf-8 -*-
count = 0
while True:
    try:
        n = int(input())
        if n == 2 or n == 3:
            count += 1
        if n > 3 and n % 2 != 0:
            for i in range(3,n):
                if n % i == 0:
                    break
                elif i == n - 1:
                    count += 1
    except  EOFError:
        break
print(count)