#include<bits/stdc++.h>
using namespace std;
bool v[100000005];
int tot;
int main(){
//freopen("count.in","r",stdin);
//freopen("count.ans","w",stdout);
int n;
int i,j,k;
cin>>n;
memset(v,true,sizeof(v));
for (i=2;i<n;i++){
if (v[i]==true){
tot++;
for (j=i+i;j<n;j+=i){
v[j] = false;
}
}
}
cout<<tot<<endl;
return 0;
}
#8数据
输入
4974953
输出
346862