#include <type_traits>
#include <vector>
#include <iostream>
constexpr auto MAX = 100000000 ; // 10^8
using int_type = std::remove_const< decltype(MAX) >::type ;
std::vector<int_type> prime_numbers()
{
const int_type SZ = MAX / 2 + 1 ;
std::vector<bool> sieve( SZ, true ) ;
for( int_type i = 2 ; i < SZ ; ++i ) if( sieve[i] )
for( int_type j = i+i ; j < SZ ; j += i ) sieve[j] = false ;
std::vector<int_type> result ;
for( int_type i = 2 ; i < SZ ; ++i ) if( sieve[i] ) result.push_back(i) ;
return result ;
}
int main()
{
auto primes = prime_numbers() ;
int_type count = 0 ;
for( auto p : primes )
{
for( auto p2 : primes )
{
if( p*p2 > MAX ) break ;
if( p2 >= p ) ++count ;
}
}
std::cout << count << '\n' ; // 17427258
}
I2luY2x1ZGUgPHR5cGVfdHJhaXRzPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8aW9zdHJlYW0+Cgpjb25zdGV4cHIgYXV0byBNQVggPSAxMDAwMDAwMDAgOyAvLyAxMF44CnVzaW5nIGludF90eXBlID0gc3RkOjpyZW1vdmVfY29uc3Q8IGRlY2x0eXBlKE1BWCkgPjo6dHlwZSA7CgpzdGQ6OnZlY3RvcjxpbnRfdHlwZT4gcHJpbWVfbnVtYmVycygpCnsKICAgIGNvbnN0IGludF90eXBlIFNaID0gTUFYIC8gMiArIDEgOwogICAgc3RkOjp2ZWN0b3I8Ym9vbD4gc2lldmUoIFNaLCB0cnVlICkgOwogICAgZm9yKCBpbnRfdHlwZSBpID0gMiA7IGkgPCBTWiA7ICsraSApIGlmKCBzaWV2ZVtpXSApCiAgICAgICBmb3IoIGludF90eXBlIGogPSBpK2kgOyBqIDwgU1ogOyBqICs9IGkgKSBzaWV2ZVtqXSA9IGZhbHNlIDsKCiAgICBzdGQ6OnZlY3RvcjxpbnRfdHlwZT4gcmVzdWx0IDsKICAgIGZvciggaW50X3R5cGUgaSA9IDIgOyBpIDwgU1ogOyArK2kgKSBpZiggc2lldmVbaV0gKSByZXN1bHQ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