<?php
$count = trim(fgets(STDIN));
for ($i = 0; $i < $count; $i++) {
    $n = trim(fgets(STDIN));
    print $n;
	$out = $out + isprime($n);
}
	print($out);
function isprime($n) {
	if ($n == 2) {
		echo 'is 2', "\n";
		return 1;
	} else if ($n % 2 == 0) {
		echo '% is 0', "\n";
		return 0;
	} else {
		for ($i = 3; sqrt($n) >= $i; $i+=2) {
			if ($n % $i == 0) {
				echo 'not prime', "\n";
				return 0;
				break;
			}
		}
		echo 'is prime', "\n";
		return 1;
	}
}
?>