#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
 
int main(void){
int unti[1000002] = {0};
fill(unti,unti + 1000001;n++)
{
if(unti[n] == 0)
{
for(int a = 2;(a * n) < 1000001;a++)
{
    if((a * n  ) < 1000001 ) unti[a * n]++;
}
}
}
int b;
for(int i;i <= 31;i++){
cin >> b

int cnt = (count(unti,unti+b+1,0) - 2);
cout << cnt << endl;
}
return 0;
}