#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector X(N + 1, 0); iota(X.begin(), X.end(), 0); vector Y(N + 1, true); for (int64_t i = 2; i <= N; i++) { if (!Y[i]) continue; for (int64_t j = i; j <= N; j += i) { while (X[j] % (i * i) == 0) { X[j] /= i * i; } Y[j] = false; } } vector Z(N + 1, 0); for (int i = 0; i <= N; i++) { Z[X[i]]++; } int64_t res = 0; for (int i = 1; i <= N; i++) { res += Z[i] * Z[i]; } cout << res << '\n'; return 0; }