Problem:
Prime Numbers

A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.

Write a program which reads a list of N integers and prints the number of prime numbers in the list.

Input

The first line contains an integer N, the number of elements in the list.

N numbers are given in the following lines.

Output

Print the number of prime numbers in the given list.

Constraints

1 ≤ N ≤ 10000

2 ≤ an element of the list ≤ 108

Sample Input 1

5
2
3
4
5
6

Sample Output 1

3

Sample Input 2

11
7
8
9
10
11
12
13
14
15
16
17

Sample Output 2

4

Solution in Rust (judge verdict: Accepted)

#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_vec3<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read::<T>()).collect()
}

fn is_prime(x: u32) -> bool {
    let two: u32 = 2;
    let three: u32 = 3;
    match x {
        x if x == two => true,
        x if x < two || x % two == 0 => false,
        _ => {
            let mut i = three;
            while i * i <= x {
                if x % i == 0 {
                    return false;
                }
                i = i + two;
            }
            true
        }
    }
}

fn main() {
    let n = read::<usize>();

    let v = read_vec3::<u32>(n);
    let mut count = 0;
    for i in 0..n {
        if is_prime(v[i]) {
            count += 1;
        }
    }
    println!("{}", count);
}