#include <iostream>
#include <iterator>
#include <algorithm>

template <typename T, int N>
int size(T (&)[N])
{
	return N;
}

bool primeCheck(int p) {
    if(p<2) return false;

    // Really slow way to check, but works
    for(int d = 2; d<p; ++d) {
        if (0==p%d) return false; // found a divisor
    }
    return true; // no divisors found
}

int countPrimes(int *a, int size) {
    int numberPrime = 0;
    for (int i = 0; i < size; ++i) {
        // For each element in the input array, check it,
        // and increment the count if it is prime.
        if(primeCheck(a[i]))
            ++numberPrime;
    }
    return numberPrime;
}

int main() {
	int input[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
	//                *  *     *     *             *   5 total
	std::cout << countPrimes(input, size(input)) << '\n';
	std::cout << std::count_if(std::begin(input), std::end(input), primeCheck) << '\n';
	return 0;
}