#include<iostream>

using namespace std;

int main(){
        long long  n=1, j=0, arr[30];
//      while( n>0){
        long long count=1;
        cin >> n;
        if(n==1){
        count = 0;
        goto END;}
        if(n==2)
                goto END;
        for(int i=3; i<=n; i+=2){
                if(i == 3 || i == 5 || i == 7)
                        count++;
                if (i % 3 ==0 || i % 5 == 0 || i % 7 == 0)
                        continue;
                else
                        count++;
        }
        //      END:arr[j++] = count;
//}
        //for(int i=0; i<j; i++){
                END:cout << count << endl;
//}


        return 0;

}