#include <stdio.h>
#include <iostream>
#include <string.h>

using namespace std;



void markMultiples(bool arr[], int a, int n)
{
    int i = 2, num;
    while ( (num = i*a) <= n )
    {
        arr[ num-1 ] = 1; 
        ++i;
    }
}
 

void Sieve(int n)
{
	int count=0;
    
    if (n >= 2)
    {
        
        bool arr[n];
        memset(arr, 0, sizeof(arr));
 
        
        for (int i=1; i<n; ++i)
        {
            if ( arr[i] == 0 )
            {
                
                count++;
                markMultiples(arr, i+1, n);
            }
        }
    }
    cout<<count<<endl;
}
 

int main()
{
	for (int i=0; i<=30; i++)
	{
	
    int n ;
    cin >> n;
    
    
    Sieve(n);}
    return 0;
}