#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include using namespace std; //using namespace atcoder; #define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repr(i, 0, n) #define INF 2e9 #define MOD 1000000007 //#define MOD 998244353 #define LINF (long long)4e18 #define jck 3.141592 #define PI acos(-1.0) const double EPS = 1e-10; using ll = long long; using Pi = pair; using Pl = pair; bool is_square(int a){ int b = sqrt(a); return b*b == a; } int main(){ int n; cin >> n; vector square_sum(n+1); repr(i,1,n+1){ if(is_square(i)) square_sum[i] = square_sum[i-1]+1; else square_sum[i] = square_sum[i-1]; } ll ans = 0; vector prime(n+1,true); vector to_prod(n+1,1); for(int i = 2; i <= n; i++){ if(!prime[i]) continue; for(int j = i; j <= n; j+=i){ prime[j] = false; int cnt = 0; int k = j; while(k%i==0){ k /= i; cnt++; } if(cnt%2==1) to_prod[j] *= i; } } repr(i,1,n+1){ if(to_prod[i] <= n){ ans += square_sum[n/to_prod[i]]; } } cout << ans << endl; }