#include <iostream>
using namespace std;

int main(){
	int n;
	while(cin>>n){
		int manko = 0;
		for(int i = 1; i <= n; i += 2){
			int ans = 1;
			for(int j = 2; j <= i/j ; j++){
				if(i % j == 0){
					ans += j + i/j;
				}
				if(i == j*j)ans -= j;
			}
			if(ans == 1) manko++;
		}
		cout << manko << endl;
	}
	return 0;
}