/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <fstream>
using namespace std;
int f(int i);
int main()
{
int n,i;
long long int s=1;
ifstream fin ("fractii.in");
fin >>n;
fin.close();
for (i=2;i<=n;i++)
s+=2*(i-f(i)-1);
ofstream fout ("fractii.out");
fout <<s;
fout.close();
return 0;
}
int f(int i)
{
int k,nr=0,ii=i;
for (k=2;k<=ii;k++)
if(i%k==0)
{
nr+=i/k-1;
do{
ii/=k;
}while(ii%k==0);
}
return nr;
}