function isPrime(num) {
	if (num == 2 || num == 3) return true;
	if (num < 2 || num % 2 == 0 || num % 3 == 0) return false;
	var max = Math.floor(Math.sqrt(num));

	for (var n = 1; n * 6 - 1 <= max; n++) {
		if (num % (n * 6 - 1) == 0 || num % (n * 6 + 1) == 0) return false;
	}
	return true;
}

var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = input.split('\n');
lines.shift();
console.log(lines.filter(isPrime).length);