#include #include #include using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) vector sieve; void sieveinit(int N){ sieve.resize(N+1,0); sieve[0] = sieve[1] = 1; for(int i=2; i*i<=N; i++) if(sieve[i] == 0){ for(int j=i*i; j<=N; j++) sieve[j] = 1; } } int main(){ int N; cin >> N; sieveinit(N); vector X(N+1); rep(i,N+1) X[i] = i; for(int i=2; i*i<=N; i++) if(sieve[i] == 0){ int sqi = i*i; for(int j=sqi; j<=N; j+=sqi) while(X[j] % sqi == 0) X[j] /= sqi; } vector sqsum(N+1,0); for(int i=1; i*i<=N; i++) sqsum[i*i]++; rep(i,N) sqsum[i+1] += sqsum[i]; int ans = 0; for(int i=1; i<=N; i++){ ans += sqsum[N / X[i]]; } cout << ans << "\n"; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;