/* All men have limits. They learn what they are and learn
   not to exceed them, I ignore mine. -Batman           */

#include <bits/stdc++.h>
//#include <Windows.h>
using namespace std;

void wakwaw(int *x) { 
     x[1] = 0; 
     x[2] = 1; 
     for (int i = 3; i <= 1000000; i += 2) 
         x[i] = 1; 
 
 
     for (int i = 3; i <= 1000; i += 2) { 
         if (x[i] == 0) 
             continue; 
         for (int j = 2; i * j <= 1000000; j++) 
            x[i * j] = 0; 
     } 
 
 
     for (int i = 3; i <= 1000000; i++) 
         x[i] += x[i-1]; 
 } 
 
 
 int main() { 
 
 
     int *arr = new int[1000001]; 
     wakwaw(arr); 
 
 
     int n; 
     while (cin >> n) { 
         cout << arr[n] << endl; 
     } 
 
 
     return 0; 
 } 