#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; vector tb(N + 1); ll ans = 0; for(int i = N; i >= 2; i--){ ll c = N / i; tb[i] = c * (c - 1) / 2; for(int j = 2 * i; j <= N; j += i) tb[i] -= tb[j]; ans += tb[i] - (c - 1); } cout << ans << '\n'; }