#include using namespace std; int div_[50001000]; int cnt[50001000]; int main(void){ int n; cin >> n; for(int i = 1; i <= n; i++) div_[i] = 1; for(int j = 2; j * j <= n; j++){ for(int k = j * j; k <= n; k += j * j){ div_[k] = j * j; } } long long ans = 0; for(int i = 1; i <= n; i++){ int j = i; if (div_[i] != 1){ j /= div_[i]; } div_[i] = j; cnt[j]++; } for(auto c: cnt){ ans += (long long) c * (long long) c; } cout << ans << "\n"; }