#include<iostream>
#include<algorithm>
using namespace std;
const int N=1e6+5;
bool vis[N];
int main()
{
int n; cin>>n;
for(int i=2;i<=n/i;i++)if(!vis[i])
for(int j=i*i;j<=n;j+=i)
vis[j]=1;
int ans=0;
for(int i=2;i<=n;i++)
if(!vis[i]) ans++;
printf("%d\n",ans);
return 0;
}