#include <iostream>

using namespace std;

int main(){
  int n,visited,cnt=0;
  
  while(cnt<30){
    int count =0;
    cnt++;
    cin >> n;
    if(n==0)count =0;
    for(int j=2;j<=n;j++){
      visited=0;
      for(int i = 2;i<=n;i++){
	
	if(j%i==0&&j!=i)visited=1;
	else if(j%i==0&&j==i&&visited==0)count++;
	/*	cout<<"j/"<<j<<" i:"<<i <<" count:"<<count<<" visited"<<visited<<endl;    */ 
      }
    }
    cout << count << endl;
  }
  return 0;
}