#include <iostream>                                                                                                     
#include <vector>                                                                                                       
                                                                                                                        
using namespace std;                                                                                                    
                                                                                                                        
int main() {                                                                                                            
  int n;                                                                                                                
  int count;                                                                                                            
  while (cin >> n) {                                                                                                    
    if (n == 1) { cout << 0 << endl; return 0; }                                                                        
    if (n == 2) { cout << 1 << endl; return 0; }                                                                        
                                                                                                                        
    vector<int> prime_numbers; // 素数リスト                                                                            
    prime_numbers.push_back(2);                                                                                         
    count = 1;                                                                                                          
    for (int i = 3; i <= n; i++) {                                                                                      
      bool prime = true;                                                                                                
      for (vector<int>::iterator itr = prime_numbers.begin(); itr != prime_numbers.end(); itr++) {                      
        if (i % *itr == 0) {                                                                                            
          prime = false;                                                                                                
          break;                                                                                                        
        }                                                                                                               
      }                                                                                                                 
      if (prime) {                                                                                                      
        prime_numbers.push_back(i);                                                                                     
        count += 1;                                                                                                     
      }                                                                                                                 
    }                                                                                                                   
    cout << count << endl;                                                                                              
  }                                                                                                                     
  return 0;                                                                                                             
} 