#include #include using namespace std; typedef long long ll; std::vector enum_prime(int n){ // containing n std::vector res; if (n <= 1) return res; std::vector p(n + 1); fill(p.begin() + 2, p.end(), true); for(int i = 2; i <= n; i++){ if(p[i]){ res.push_back(i); for(int j = i * 2; j <= n; j += i) p[j] = false; } } return res; } int d[50000005]; ll b[50000005]; int main() { int n; cin >> n; vector prime = enum_prime(10000); for(int i = 1; i <= n; i++) d[i] = i; for(int p : prime){ int q = p * p; for(int j = q; j <= n; j += q){ while(d[j] % q == 0) d[j] /= q; } } for(int i = 1; i <= n; i++) b[d[i]]++; ll ans = 0; for(int i = 1; i <= n; i++) ans += b[i] * b[i]; cout << ans << endl; }