#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
 
int main(){
int unti[1000001] = {0};
fill(unti,unti + 1000001,0);
for(int n = 2;n < 1000001;n++)
{
if(unti[n] == 0)
{
for(int a = 2;(a * n) < 1000001;a++)
{
    if((a * n  ) < 1000001 ) unti[a * n]++;
}
}
}
int b;
while(cin >> b )
{
int cnt = (count(unti,unti+b+1,0) - 2);
cout << cnt ;
    }
 
 
}