#include <iostream>
#include <fstream>
using namespace std;
ifstream f("fractii.in");
ofstream g("fractii.out");
bool reductibil(int N,int i,int j)
{ if(i<=j)
{
for(int u=2; u<=i; u++)
{
if((i%u==0)&&(j%u==0))
{
return true;
}
}
}else
{
for(int u=2; u<=j; u++)
{
if((i%u==0)&&(j%u==0))
{
return true;
}
}
}
return false;
}
int main()
{int N, nrfr=0;
f>>N;
for(int i=1; i<=N; i++)
{
for(int j=1; j<=N; j++)
{
if( (((i%j!=0) && (j%i!=0)) || ((j==1) || (i==1)))&&(!reductibil(N,i,j)) )
{
nrfr=nrfr+1;
}
}
}
g<<nrfr;
f.close();
g.close();
return 0;
}