<?php
	$n = trim(fgets(STDIN));
	$a = array();
	while ($n--) {
		$a[] = trim(fgets(STDIN));
	}
	echo sosu($a) . "\n";

	function sosu($a) {
		$cnt = 0;
		foreach ($a as $v) {
			$flg = false;
			for ($i = 2; $i < $v; $i++) {
				if ($v % $i == 0) {
					$flg = true;
					break;
				}
			}
			if (!$flg) $cnt++;
		}
		return $cnt;
	}