#include <iostream>
#include <vector>
using namespace std;
int main()
{
const int N = 2e7;
vector <long long> is_prime(N, true);
is_prime[0] = is_prime[1] = false;
vector <long long> primes;
for(long long i = 2; i < N; i++)
{
if(is_prime[i]) primes.push_back(i);
for(int j = 0; j < primes.size() && i*primes[j] < N; j++)
{
is_prime[i*primes[j]] = false;
if(i%primes[j] == 0) break;
}
}
cout << primes.size();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSAKewoJY29uc3QgaW50IE4gPSAyZTc7CgkKCXZlY3RvciA8bG9uZyBsb25nPiBpc19wcmltZShOLCB0cnVlKTsKCWlzX3ByaW1lWzBdID0gaXNfcHJpbWVbMV0gPSBmYWxzZTsKCQoJdmVjdG9yIDxsb25nIGxvbmc+IHByaW1lczsKCQoJZm9yKGxvbmcgbG9uZyBpID0gMjsgaSA8IE47IGkrKykKCXsKCSAgICAgIGlmKGlzX3ByaW1lW2ldKSBwcmltZXMucHVzaF9iYWNrKGkpOwoJCgkgICAgICBmb3IoaW50IGogPSAwOyBqIDwgcHJpbWVzLnNpemUoKSAmJiBpKnByaW1lc1tqXSA8IE47IGorKykKCSAgICAgIHsKCSAgICAgICAgICAgICAgIGlzX3ByaW1lW2kqcHJpbWVzW2pdXSA9IGZhbHNlOwoJCgkgICAgICAgICAgICAgICBpZihpJXByaW1lc1tqXSA9PSAwKSBicmVhazsKCSAgICAgIH0KCX0KCQoJY291dCA8PCBwcmltZXMuc2l6ZSgpOwoJCQoJcmV0dXJuIDA7Cn0=