This documentation is automatically generated by online-judge-tools/verification-helper
#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/problems/ALDS1_1_C"
#include "./../math/Eratosthenes.cpp"
#include <iostream>
using namespace std;
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
auto table = Eratosthenes(100000000);
int n;
cin >> n;
int ans = 0;
while (n--) {
int x;
cin >> x;
ans += table[x];
}
cout << ans << '\n';
}
#line 1 "test/Eratosthenes.test.cpp"
#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/problems/ALDS1_1_C"
#line 2 "math/Eratosthenes.cpp"
#include <vector>
std::vector<bool> Eratosthenes(size_t n) {
std::vector<bool> result(n + 1, true);
result[0] = result[1] = false;
for (size_t i = 2; i * i <= n; ++i) {
if (result[i]) {
for (size_t j = i * i; j <= n; j += i) result[j] = false;
}
}
return result;
}
#line 3 "test/Eratosthenes.test.cpp"
#include <iostream>
using namespace std;
int main() {
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
auto table = Eratosthenes(100000000);
int n;
cin >> n;
int ans = 0;
while (n--) {
int x;
cin >> x;
ans += table[x];
}
cout << ans << '\n';
}