//
//  main.cpp
//  TestCpp
//
//  Created by Shahab Uddin on 05/21/13.
//  Copyright (c) 2013 ___Shahab__. All rights reserved.
//

#include <cstdio>
#include <cmath>

bool isPrime (int p)
{
    if ( p < 2 ) return false;

    if ( p == 2 ) return true;

    int squareRoot = (int) sqrt (p);

    for ( int i = 2; i <= squareRoot; i++ ) {
        if ( p % i == 0 )
            return false;
    }

    return true;
}

int main(int argc, const char * argv[])
{
    int n;

    while ( scanf ("%d", &n) != EOF ) {
        int ans = 0;

        for ( int i = 2; i < n; i++ ) {
            if (isPrime(i)) ans++;
        }

        printf ("%d\n", ans);
    }

    return 0;
}