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