#include #include using namespace std; using namespace atcoder; #define rep(i,n)for (int i = 0; i < int(n); ++i) #define rrep(i,n)for (int i = int(n)-1; i >= 0; --i) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() template void chmax(T& a, const T& b) {a = max(a, b);} template void chmin(T& a, const T& b) {a = min(a, b);} using ll = long long; using P = pair; using VI = vector; using VVI = vector; using VL = vector; using VVL = vector; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; VI d(n + 1); d[1] = 1; VI lpf(n + 1); VI ps; ps.reserve(n / 10); for(int p = 2; p <= n; p++) { if (lpf[p] == 0) { d[p] = p; ps.push_back(p); } int v = d[p]; for(int q: ps) { ll t = (ll)p * q; if (t > n || q > p) break; lpf[t] = q; if (v % q == 0) d[t] = v / q; else d[t] = v * q; } } VI hist(n + 1); for(int i = 1; i <= n; i++) hist[d[i]]++; ll ans = 0; for(int i = 1; i <= n; i++) ans += (ll) hist[i] * hist[i]; cout << ans << '\n'; }