#include<bits/stdc++.h>
using namespace std;
int gcd(int x, int y){
if(y == 0){
return x;
}
return gcd(y, x % y);
}
int zhsh(int s){
if(s==1){
return false;
}
for(int j=2;j<=s;j++){
if(s%j==0&&s!=j){
return false;
}
}
return true;
}
int n,ans;
int main(){
cin>>n;
for(int i=2;i<=n;i++){
for(int j=2;j<=n;j++){
if(zhsh(gcd(i,j))==true){
ans++;
}
}
}
cout<<ans;
}