#include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; using P = pair; map memo; bool sq[50000001]; int cnt[50000001]; void init(){ for(int i = 2; i*i <= 50000000; i++){ int m = i*i; for(int j = 1; j*m <= 50000000; j++){ sq[j*m] = true; } } for(int i = 1; i <= 50000000; i++) cnt[i] = cnt[i-1] + (sq[i] ? 1 : 0); } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; init(); int n; cin >> n; ll ans = 0; for(int a = 1; a*a <= n; a++){ for(int b = 1; b*b <= n; b++){ int p = n/(a*a); int q = n/(b*b); ans += min(p, q)-cnt[min(p, q)]; } } cout << ans << endl; }