#include using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<(int)(n);i++) int totient(int x){ int ret = x; for(int p=2;p*p<=x;p++){ if(x%p==0){ ret -= ret/p; while(x%p==0) x/=p; } } if(x!=1) ret -= ret/x; return ret; } int main(){ ll n; cin>>n; ll ans=0; ans+=n*(n-1)/2; for(int i=2;i<=n;i++){ ans-=totient(i); } for(int i=2;i<=n;i++){ ans-=n/i-1; } cout<