A number is called almost prime if it has exactly two distinct prime divisors. For example, numbers 6, 18, 24 are almost prime, while 4, 8, 9, 42 are not. Find the amount of almost prime numbers which are between 1 and n, inclusive.

Input contains one integer number n (1 ≤ n ≤ 3000).

Output the amount of almost prime numbers between 1 and n, inclusive.

#include <iostream>
#include <bitset>
#include <vector>
using namespace std;
const int n = 10000000;
bitset<10000007>b;
vector<long long >primes;
void prime()
{
    b.set();
    b[0]=0;
    b[1]=0;
    b[2]=1;
        primes.push_back(2);
    for(long long  i=3;i<=10000000;i+=2)
    {
        if(b[i]==1)
        {
            primes.push_back(i);
            for(long long  j=i*i;j<=10000000;j+=i)
            {
                b[j]=0;
            }
        }
    }

}
int main() {
  prime();
  int n;
  cin>>n;

  int ctr=0;
  for(int k=6;k<=n;k++)
  {
      int ans=0;
    //  int f=0;
  for(int j=0;(primes[j]/2)<=k;j++)
  {
      if(k%primes[j]==0)
      ans++;
  }

  if(ans==2)
      {
         ctr++;
      }

  }

 cout<<ctr;
}

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <string.h>
#define INF 2147483647
#define LLINF 9223372036854775807
typedef long long ll;
using namespace std;
bool is_prime(int x){
	for(int i=2;i<x;i++){
		if(x%i==0)return false;
	}
	return true;
}
int main(){
	int n;
	cin>>n;
	int cnt=0;
	for(int i=2;i<=n;i++){
		int ans=0;
		for(int j=2;j*j<=i;j++){
			if(i%j!=0)continue;
			if(is_prime(j)){
				ans++;
			}
			if(j*j==i)continue;
			if(is_prime(i/j)){
				ans++;
			}
		}
		if(ans==2)cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}

#include<iostream>
#include<math.h>
using namespace std;
int dv(int n);
int dv(int n){
	for(int i=2;i<=n/3;++i){
		if(n%i==0) return i;
	}
	return 0;
}
bool ip(int n);
bool ip(int n){
	if(n==2) return 1;
	for(int i=2;i<=sqrt(n);++i){
		if(n%i==0) return 0;
	}
	return n>2?1:0;
}
int main(){
	int n,ans=0,t,k;
	cin>>n;
	do{
		t=n; k=dv(t);
		if(k!=0){
		while(t%k==0){
			 t=t/k;
			}
		if(t!=1){
			if(ip(t)) ans++;
			else{
			k=dv(t);
			while(t%k==0){
			 t=t/k;
			}
			if(t==1) ans++;
			}
		}}
		n--;
	}while(n>5);
	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
bool is_pal(int x)
{
	for(int i=2;i<x;i++)
	{
		if(x%i==0)return false;
	}
	return true;
}
int main()
{
	int n;
	cin>>n;
	int cnt=0;
	int ans=0;
	for(int i=3;i<=n;i++)
	{
		for(int j=2;j<n;j++)
		{
			if(i%j==0)
			{
				if(is_pal(j)==true)ans++;
			}
		}
		if(ans==2)cnt++;
		ans=0;
	}
	cout<<cnt<<endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
bool flag[maxn];
int num[maxn] = {0}, cnt[maxn] = {0};
int n, counts = 0;
void shai(int n) {
    for(int i = 2; i <= n; i++) flag[i] = true;
    for(int i = 2; i <= n; i ++)
        if(flag[i] == true)
            for (int j = i * 2; j <= n; j += i) {
                flag[j] = false;
                cnt[j] ++;
            }
}
int main() {
    scanf("%d", &n);
    shai(n);
    for (int i = 1; i <= n; i ++)
        if (cnt[i] == 2) counts ++;
    printf("%d\n", counts);
    return 0;
}

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

int flags[3001];

void seive()
{

    for (int i=2;i<=3000;i++){
        if(flags[i]==0)
        for (int j=i;j<=3000;j+=i){
            flags[j]++;
        }
    }
}

int main()
{
    seive();
    int b,ansq=0;
    cin >> b;

    for(int i=0;i<=b;i++)
    {
        if (flags[i]==2)
        {
            ansq++;
        }
    }
    cout << ansq << endl;
    return 0;
}

//hyok_A
#include <stdio.h>
#include <math.h>

int calc(int n){
    int nn = sqrt(n);
    int cnt = 0;
    for(int i = 2; i <= nn; i ++) if(n % i == 0) {
        cnt ++;
        while(n % i == 0) n /= i;
    }
    if(n > 1) cnt ++;
    return cnt;
}

int main(){
    int n;
    scanf("%d", &n);
    int ans = 0;
    for(int i = 2; i <= n; i ++) if(calc(i) == 2) ans ++;
    printf("%d\n", ans);
}

#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
    int i,j,n;
    cin>>n;
    int s=0;
    for(j=2;j<=n;j++){
        int p=j;
        int f=0;
    for(i=2;i*i<=p;i++){
        if(p%i==0){
        while(p%i==0){
            p=p/i;
        }
        f++;
        }
    }
        if(p!=1) f++;
        if(f==2) s++;
    }
    cout<<s<<endl;
}

//Almost prime
#include<iostream>
#include<cmath>
bool prime(int);
using namespace std;
int main()
{
	long int num;
	int n = 0,c=0;
	cin >> num;

	for (int i = 6; i <= num; i++)
	{
		c = 0;
		if (i % 2 == 0)
		{
			c++;

		}
		for (int j = 3; j <= i/2; j+=2)
		{
			if (i%j == 0 &&prime(j))
				c++;
		}
		if (c == 2)
			n++;
	}

	cout <<n;
//	system("pause");
	return 0;
}

bool prime(int n)
{
	bool f = true;
	for (int i = 2; i*i <= n; i++)
	{
		if (n%i == 0)
			f = false;

	}

	return f;

}

#include<bits/stdc++.h>

 using namespace std;

 int main()
{
    int n, amount(0);
    scanf("%d", &n);

    bool b[3001] = {false};
    int pfactors[3001] = {0};
    for (int i = 2; i <= n; ++i)
    {
        if (!b[i])
        {
            for (int j = i + i; j <= n; j += i)
            {
                b[j] = true;
                pfactors[j] += 1;
            }
        }

        if (pfactors[i] == 2)
        {
            amount += 1;
        }
    }
    printf("%d\n", amount);
    return 0;
}

#include<iostream>
#include<vector>
#include<cmath>
#include<string>
#include<algorithm>
#include<set>
using namespace std;
int isprime(int m)
{
	int counter = 0;
	for (int o = 1; o <=sqrt(m); o++)
	{
		if (m%o == 0)
			counter += 2;
	}
	if (counter == 2)
		return 1;
	else
		return 0;
}
int main()
{

	int n,counter=0;
	cin >> n;
	for (int i = 6; i <= n; i++)
	{
		int counter_1 = 0;
		for (int o = 2; o <= ceil(i/2); o++)
		{
			if (isprime(o) == 1)
			{
				if (i%o == 0)
				{
					counter_1 += 1;
				}
			}
		}
		if (counter_1 == 2)
			counter += 1;
	}
	cout << counter<< endl;
	return 0;

}

#include <bits/stdc++.h>
using namespace std;
void count(){
    #ifndef ONLINE_JUDGE
        freopen ("input.txt", "r", stdin);
    #endif
}
int main(){
    //count();
    int n, ans = 0;
    cin >> n;
    for(int i=1; i<=n; ++i){
        bool used[3001] = {false};
        int x = 2, y = i;
        int kol = 0;
        while(x * x <= y){
            if(y % x == 0){
                y /= x;
                if(!used[x]) kol ++;
                used[x] = true;
            }
            else x ++;
        }
        if(y > 1 && !used[y]) kol ++;
        if(kol == 2) ans ++;
    }
    cout << ans << endl;
    return 0;
}

#include <stdio.h>

long long n, i, j, res, num[10000];

int main(){
	scanf("%lld", &n);
	for(i = 2; i <= n; i++){
		if(num[i] > 0){
			if(num[i] == 2){
				res++;
			}
			continue;
		}else {
			for(j = i*2; j <= n; j += i){
				num[j]++;
			}
		}
	}
	printf("%lld\n", res);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,t[510];
bool p[3010];
bool pd(int x)
{
	int i;
	if(x==1)return false;
	for(i=2;i<=sqrt(x);i++)
	{
		if(x%i==0)return false;
	}
	return true;
}
int sys(int m)
{
	int i;
	int sum=0;
	for(i=2;i<=m;i++)
	{
		if(m%i==0)
		{
			if(pd(i))
			sum++;
		}
	}
	return sum;
}
int main()
{
	cin>>n;
	int tot=0;
	for(int i=2;i<=n;i++)if(sys(i)==2)tot++;
	cout<<tot<<endl;
	return 0;
}

#include <iostream>
using namespace std;
int is_prime(int n)
{
	for (int d = 2; d*d <= n; d++)
		if (n%d == 0)
			return 0;
	return 1;
}
int main()
{
	ios::sync_with_stdio(0);
	int n;
	while (cin >> n)
	{
		int ans = 0;
		for (int i = 6; i <= n; i++)
		{
			int divs = 0;
			for (int j = 2; divs <= 2 && j*j < i; j++)
				if (i%j == 0)
				{
					int prime1 = is_prime(j);
					int prime2 = is_prime(i / j);
					divs += prime1;
					divs += prime2;
					if (prime1 && prime2)
						break;
				}
			if (divs == 2)
				ans++;
		}
		cout << ans << endl << endl;
	}
}

//In the Name of God
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <cctype>
using namespace std;
//#include <conio.h>
int a[1000];
int b[10];
set <int> S;
bool prime(int x)
{
     for(int i=2;i<=sqrt(x);i++)
     {
         if (x%i==0)
            return true;
     }
     return false;
}
int main()
{
    int n;
	cin>>n;
	int ans=0;
	//cout<<prime(8);
	//return 0;
	for(int i=2;i<=n;i++){
		int j=0,d=0;
		S.erase(S.begin(),S.end());
		for(int j=2;j<i;j++){
			if(i%j==0&&j*j!=i){
				if(!prime(j)){
					S.insert(j);
				}
				if(!prime(i/j)){
					S.insert(i/j);
				}
			}
			if(i%j==0&&j*j==n){
				if(!prime(j)){
					S.insert(j);
				}
			}
		}
		if(S.size()==2){
			//cout<<i<<endl;
			ans++;
		}
	}
	cout<<ans;
}

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
  int n, a[3000] = {0}, s[3010] = {0}, len = 0, cnt = 0;
  cin >> n;

  for (int i = 2; i <= n; i++)
  {
    int b = 0;
    for (int j = 2; j <= trunc(sqrt(i)); j++)
      if (i % j == 0)
      {
        b = 1;
        break;
      }

    if (!b)
    {
      a[len] = i;
      len++;
    }
  }

  for (int i = 6; i <= n; i++)
  {
      int cnt1 = 0;
      for (int j = 0; j < len; j++)
        if (i % a[j] == 0)
            cnt1++;

    if (cnt1 == 2)
        cnt++;
  }

    cout << cnt;

  return 0;
}

#include<iostream>
#include<vector>
int isprime(int x)
{
    for(int i=2;i*i<=x;i++)
        if(x%i==0) return 0;
    return 1;
}
int main()
{
    using namespace std;
    vector <int> a;
    a.push_back(2);
    for(int i=3;i<1500;i+=2)
        if(isprime(i))
        a.push_back(i);
    int t=a.size();
    int n,p=0;
    cin>>n;
    for(int j=1;j<=n;j++)
    {
        int k=0;
        for(int i=0;i<t;i++)
        if(j%a[i]==0)
        {
            k++;
        }
        if(k==2)
            p++;
    }
        cout<<p<<endl;
    return 0;
}

//space optimisation using bit set
//checking if a number is prime or not ~10^14
//bitset sieve is only for a number less than 10^7 but if we have to check after it
#include<bits/stdc++.h>
using namespace std;
const int n = 10000005;
bitset<10000005>b;
vector<int>prime;
void sieve()
{
    //set all the bits
    b.set();//1,1,1,1,

    b[0]=b[1]=0;

    for(long long int i=2;i<=3000;i++)
    {
        if(b[i])
        {
            prime.push_back(i);
           for(long long int j =i*i;j<=3000;j = j+i)
           {
                    b[j]=0;
           }
        }
    }
}
//if the numvber is less than 10^7 ,then we check sieve O(1) if larger than that then we check
//O(sqrt(N)) of than number
// bool Isprime(long long int No)
// {
//     if(No <= n) return b[No] ==1 ? true:false;
//     for(long long int i =0; prime[i] * prime[i] <=No ;i++)
//     {
//         if(No%prime[i] ==0 ) return false;
//     }
//     return true;
// }
int main()
{
    sieve();
//    if(Isprime(2131234113)) cout<<"yes it is";
//    else cout<<"its not ";
int No;
cin>>No;
int count =0,num=0;
for(int j=2;j<=No;j++)
{  count =0;
       for(int i =0;i<prime.size();i++)
       {
          if(j%prime[i]==0)
         {
            count+=1;
         }
         if(count>2) break;

      }
      if(count==2)num+=1;
}
cout<<num;
   return 0;
}

#include<map>
#include<cstdio>
#include<vector>
#include<iostream>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#define INF (1<<15)
using namespace std;
//int graph[101][101];

int main()
{
    bool check[3001];
    for(int i=0;i<3001;i++)
        check[i] = false;
    check[0] = 1;
    check[1] = 1;
    vector<int> primes;

    for(int i=0;i<3000;i++)
    {
        if(check[i]==0)
        {
            primes.push_back(i);
            for(int j=i*i;j<3000;j+=i)
                check[j] = true;
        }
    }
    int n;

    cin>>n;
    int last =0;

    for(int i=2;i<=n;i++)
    {
        int count =0;
        for(int j=0;j<primes.size();j++)
        {
            if(primes[j]*2>i)
                break;
            else if(i%primes[j]==0)
                count++;
        }
        if(count==2)
            last++;
    }
    cout<<last<<endl;

}

#include<iostream>
#include<vector>
#include<math.h>
using namespace std;
typedef long long ll;
vector<int> prime = {2, 3};
bool is_prime(int e)
{
	if (e <= 1) return 0;
	for(int i = 2; i <= sqrt(e); i++)
		if (!(e%i)) return 0;
	return 1;
}
bool is_almostprime(int e)
{
	int cnt = 0;
	for(int i = 0; i < prime.size() && prime[i] <= e; i++)
		if (!(e%prime[i])) cnt++;
	return cnt == 2;
}
int main(void)
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, cnt = 0;
	cin>>n;
	for(int i = 0; i <= 3000; i += 6)
	{
		if (is_prime(i-1)) prime.push_back(i-1);
		if (is_prime(i+1)) prime.push_back(i+1);
	}
	for(int i = 0; i <= n; i++)
		if (is_almostprime(i)) cnt++;
	cout<<cnt;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,a[3001],ans;
int main()
{
    a[1]=1;
    cin>>n;
    for(int i=2;i<=n;i++)
    {
    	if(a[i]==0)
    	{
    		for(int j=2;i*j<=n;j++) a[i*j]++;
		}
    }
    for(int i=1;i<=n;i++)
    {
    	if(a[i]==2) ans++;
	}
    cout<<ans;
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

bool status[1000010];
int result[10000000];
void siv()
{
    int i,j,sum,rem,count,temp,k;
	int N=1000000;
	int sq=sqrt(N);
	for(int i=4;i<=N;i+=2) status[i]=1;
	for(int i=3;i<=sq;i+=2){
		if(status[i]==0)
		{
			for(int j=i*i;j<=N;j+=i) status[j]=1;
		}
	}
	status[1]=1;

	for(i=6;i<=3000;i++)
    {
        count=0;
        for(j=2;j<=i/2;j++)
        {

            if(status[j]==0)
            {
                if(i%j==0)
                {
                    count++;
                }
            }
            if(count>2)
            {
                break;
            }

        }
        if(count==2)
        {
            result[i]=count;
        }
    }
}

int main()
{
    int n,count,i;
    siv();
    while(scanf("%d",&n)!=EOF)
    {
        count=0;
        for(i=6;i<=n;i++)
        {
            if(result[i]==2)
            {
                count++;
            }
        }
        printf("%d\n",count);
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{

   int n=0;
    vector<int> prime(3001,1);
    prime[1]=prime[0]=0;
    vector<int> cnt(3001,0);
    for(int i=2;i<=3000;i++)
    {
    	if(prime[i])
    	{
    	for(int j=2;j*i<=3000;j++)
    	{
    		prime[i*j]=0;
    		cnt[i*j]++;
		}
    	}
	}
	int s=0;
	for(int i=2;i<3001;i++)
	{
		if(cnt[i]==2)
		cnt[i]=1;
		else
		cnt[i]=0;
		s=s+cnt[i];
		cnt[i]=s;
	}
    cin>>n;
    cout<<cnt[n]<<endl;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,a[3001],ans=0;
int main()
{
	int i,j;
	a[1]=1;
	cin>>n;
	for(i=2;i<=n;i++)
	{
		if(a[i]==0)
		{
			for(j=2;j*i<=n;j++)
			a[i*j]++;
		}
	}
	for(i=1;i<=n;i++)
	{
		if(a[i]==2)
		ans++;
	}
	cout<<ans;
	return 0;
}

#include <stdio.h>

int main()
{
    int number,num,i;
    int index=0;
    int count=0, j=0;
    int k;
    int yaksu[5000]={0};
    int m=0;

    scanf("%d",&number);
    for(k=1;k<=number;k++)
    {
        count = 0;
        index=0;
        num=1;
        while(num<=k)
        {
            if(k%num==0)  // 나누어 떨어지면
            {
                yaksu[index] = num;
                index++;
            }
            num++;  // 다음 수로 넘어갑니다.
        }
        for(j=1;j<index;j++)
        {
            for(i=2;i*i <= yaksu[j];i++)
            {
                if(yaksu[j]%i==0) break;
            }
            if(i*i>yaksu[j])
            {
                count++;
            }
        }
        if(count==2)
        {
            m++;

        }
    }

    printf("%d", m);
    return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <numeric>
#define ll long long
const ll mod = 1e9 + 7;
using namespace std;

int main()
{
	int n, ans = 0;
	cin >> n;
	vector<int>A(n + 1, 1), B;
	A[0] = A[1] = 0;
	for (int i = 2; i <= n; i++)
		if (A[i])
		{
			B.push_back(i);
			for (int u = 2 * i; u <= n; u += i)
				A[u] = 0;
		}
	for (int i = 6; i <= n; i++)
	{
		int j = 0;
		for (int u = 0; u < B.size(); u++)
			j += i % B[u] == 0;
		ans += j == 2;
	}
	cout << ans;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,a[3005]={0},s=0;
	cin>>n;
	for(int i=2;i<=n;i++)
	{
		if(a[i]==0)
		{
			for(int j=i;j<=n;j+=i)
			{
				a[j]++;
			}
		}
		if(a[i]==2)s++;
	}
	cout<<s<<endl;
}

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

bitset<30000> bs;
vector<int> v;
long long sieve_size;

void sieve(int n){
	sieve_size = n+1;
	bs.set();
	bs[0] = bs[1] = 0;
	for(int  i = 2; i <= sieve_size; i++){
		if(bs[i]){
			for(int j = i*i; j <=sieve_size; j+=i)bs[j] = 0;
			v.push_back(i);
		}
	}
}

int sieveMod( int n){
	int count = 0, temp, current;
	for(int i = 2; i <= n; i++){
		temp = 0;
		for(int j = 0; j < v.size(); j++){
			if(i < v[j] )break;
			current = i;
			if(i%v[j] == 0){
				while(current%v[j] == 0)current/=v[j];
				temp++;
			}
		}
		if(temp == 2)count++;
	}
	return count;
}
int main(){
	int ini, n;
	sieve(3000);
	while(scanf("%d", &n) > 0){
		printf("%d\n", sieveMod(n));
	}

	return 0;
}
// 1456578464787

#include<bits/stdc++.h>
using namespace std;
bool check(int x) {
    int num = 0;
    for (int i = 2; i * i <= x; ++i) {
        if (x % i == 0) {
            ++num;
            while (x % i == 0)
                x /= i;
            if (x == 0)
                break;
        }
    }
    if (x != 1) ++num;
    return num == 2;
}

int main() {
    int n;
    while (scanf ("%d", &n) != EOF) {
        int res = 0;
        for (int i = 6; i <= n; ++i)
            res += check(i);
        printf ("%d\n", res);
    }
    return 0;
}

#include <iostream>
using namespace std;
int n,res=0;
int main()
{
	scanf("%d",&n);
	for (int a=1;a<=n;a++)
	{
		int tap=0;
		int i=a;
		for (int j=2;j<=i;j++)
		{
			if (i%j==0)
			{
				tap++;
				while (i%j==0)
				{
				    i/=j;
				}
			}
		}
		if (i!=1) tap++;
		if (tap==2) res++;
	}
	cout <<res;
	return 0;
}

//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
#include<queue>
#include<map>
#include<vector>
#include<cmath>
#include<fstream>
#include <set>
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
const int  MAXN =1e6+10;
const int mod = 998244353 ;
const long long INF = 0x7f7f7f7f7f7f7f7f;
#define eps 1e-8
#define PI 3.1415926535898
#define lowbit(x) (x&(-x))
#define inf 0x3f3f3f3f3f
using namespace std ;
//set<ll>::iterator it;
typedef long long ll;
int main()
{
	int ans=0;
	int n;
	scanf("%d",&n);
	for(int i=6;i<=n;i++)
	{
		int xx=0;
		for(int j=2;j*j<i;j++)
		{
			if(i%j==0)
			{
				int x=j,y=i/j;
				int flag=1;
				for(int k=2;k*k<=x;k++)
				{
					if(x%k==0)
					{
						flag=0;
						break;
					}
				}
				if(flag) xx++;
				flag=1;
				for(int k=2;k*k<=y;k++)
				{
					if(y%k==0)
					{
						flag=0;
						break;
					}
				}
				if(flag) xx++;
			}
		}
		if(xx==2) ans++;
	}
	printf("%d\n",ans);
}

#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <map>
#include <iomanip>
#include <ios>
#include <iostream>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <fenv.h>
#define mp make_pair
#define fs first
#define se second
#define memset(a,t) memset(a,t,sizeof(a))
using namespace std;
int bq[3005];
int main(){
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);
	int n,i,j,ans=0;
	cin>>n;
	for(i=2;i<=n;i++){
		for(j=2;j<i;j++) if(i%j==0&&bq[j]==0) bq[i]++;
		if(bq[i]==2) ans++;
	}
	cout<<ans<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int s,ans=0;

bool pande(int ss)
{
    if(ss==2)
    {
        return 1;
    }
    for(int i=2;i<=sqrt(ss);i++)
    {
        if(ss%i==0)
        {
            return 0;
        }
    }
    return 1;
}

bool pand(int ss)
{
    int i=2,sum=0;
    while(i<=ss)
    {
        if(ss%i==0 && pande(i))
        {
            sum++;
        }
        i++;
    }
	if(sum==2) return 1;
	else return 0;
}

int main()
{
    cin>>s;
    for(int i=1;i<=s;i++)
    {
        if(pand(i))
        {
            ans++;
        }
    }
    cout<<ans;
    return 0;
}

#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>

using namespace std;
int lcs (string s,string b,int x,int y)
{
	if (x==0 ||y==0)
		return 0;
	if (s[x-1]==b[y-1])
		return 1+lcs(s,b,x-1,y-1);
	else
		return max(lcs(s,b,x-1,y),lcs(s,b,x,y-1));
}
int main()
{
	bool b=false;
	int x;
	cin>>x;
	int c=0,ce=0;
	for (int i=6;i<=x;i++){
		ce=0;
		for (int j=2;j<=i/2;j++)
		{

			if (i%j==0){
			//	cout<<"hh\n";
			b=false;
			for (int q=2;q<=j/2;q++)
			{
				if (j%q==0){
					b=true;
					break;
				}
			}
			if (!b)
				ce++;

			}

		}
		if (ce==2)
			c++;

	}
	cout<<c<<endl;
	return 0;
}

#include <iostream>
using namespace std;
int is_prime(int n)
{
	for (int d = 2; d*d <= n; d++)
		if (n%d == 0)
			return 0;
	return 13;
}
int main()
{
	int n;
	while (cin >> n)
	{
		int ans = 0;
		for (int i = 6; i <= n; i++)
		{
			int divs = 0;
			for (int j = 2; j*j < i; j++)
			{
				if (i%j == 0)
				{
					int prime1 = is_prime(j);
					int prime2 = is_prime(i / j);
					if (prime1)
						divs++;
					if (prime2)
						divs++;
				}
			}
			if (divs == 2)
				ans++;
		}
		cout << ans << endl << endl;
	}
}

#include <iostream>
#include <cmath>
using namespace std;
bool prime_test (int a ){
    bool c = true;
    int i = 2, b = 0, j = 2;
    while ( i*i < a){
        if ( a%i == 0 ){
            b = a/i;
            while ( b % i == 0 )
            b/=i;
            j = i + 1;
            if ( b == 1 ) c = false;
            while ( j*j <= b ){
                if ( b % j == 0 && (b/j)%j != 0 ){ c = false; break;}
                else j++;
            }
            break;
        } else i++;

    }
    if ( i*i >= a )
    return false;
    return c;
}
int main()
{
    int n, i, c = 0;
    cin >> n;
    for ( i = 1 ; i <= n ; i++)
    if ( prime_test(i) == true ) c++;
    cout << c;
    return 0;
}

#include <iostream>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <cmath>
using namespace std;

bool prime (int number );
int check_almostPrime (int n);
int main()
{
    int n, Count = 0 ;
    cin>>n;
    for (int i = 1; i <= n ; i++){
        Count += check_almostPrime(i);
    }
    cout<<Count<<endl;

    return 0;
}

bool prime (int number ){
vector <int> v ;
for (int i=1 ; i <= number ; i++){
    if (number % i == 0)
        v.push_back(i);
}
    if (v.size()==2)
        return true ;
    else
        return false ;
}

int check_almostPrime (int n){   // function of program

    int counter = 0 , Count = 0 ;

    vector <int> v ;

 for ( int i = 1 ; i <= sqrt(n);i++){

    if (n % i == 0){
    v.push_back(i);
    if (i == (n/i))
        continue ;
    else
    v.push_back(n/i);

    }
 }

 for (int i = 0 ; i < v.size();i++){
    if ( prime(v[i])== true )
        counter++;
 }
    if (counter == 2)
        Count ++ ;

        return Count ;
}

#include<iostream>
using namespace std;
int main(){
    int n,a[3001]={0},ans=0,i,j;
	a[1]=1;
	cin>>n;
	for(i=2;i<=n;i++){
    	if(a[i]==0){
	    	for(j=2;j*i<=n;j++){
	    	    a[i*j]++;
            }
	    }
    }
	for(i=1;i<=n;i++){
	    if(a[i]==2){
            ans++;
        }
    }
	cout<<ans;
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define sn scanf
#define pn printf
#define M 3000+50
using namespace std;

vector<ll>divc(M, 0);
vector<ll>prime;

void priem_check()
{
	for (ll i = 0; i < M; i++)prime.pb(i);

prime[0]=prime[1]=0;
	for (ll i = 2; i < M; i++)
	{
		if (prime[i] == i)
		{
			for (ll j = i + i; j < M; j += i)
			{
				prime[j] = i;
				divc[j]++;
			}
		}
	}

}

int main()
{
	priem_check();

		ll n,c=0;
		cin >> n;

	for (int i =0; i <=n; i++) {
		if (divc[i] == 2){//cout<<i<<endl;
			c++;}
	}

cout<<c<<endl;

	return 0;
}

#include <iostream>
#include<bits/stdc++.h>
using namespace std;
const int N=3009;
int n,prime[N],ans,cnt[N];
void seive()
{
    memset(prime,1,sizeof prime);
    prime[0]=prime[1]=0;
    for(int i=2;i<N;i++)
    {
        if(prime[i])
        {
            for(int j=i+i;j<N;j+=i)
                cnt[j]++,prime[j]=0;
        }
    }
}
int main()
{
    cin>>n;
    seive();
    for(int i=2; i<=n; i++)
    {
        if(cnt[i]==2)ans++;
    }
    cout<<ans<<endl;
    return 0;
}

#include <iostream>

using namespace std;

bool pchisla (int a)
{
	int i,j; bool type;
	j=0;
	for (i=2;i<a;i++)
	if (a%i==0) {j=j+1;}

	if (j==0) type=true; else type=false;

	return  type;
}

int main()
{
	int n,i,j,b=0,kol=0;

	cin >> n;

	for (i=1;i<n+1;i++) {

	for (j=2;j<i+1;j++) {

	if (i%j==0 && i!=j &&pchisla(j)==true) {b=b+1;}
}   if (b==2) {kol=kol+1;}
	b=0;
}
	cout << kol;
}

#include<bits/stdc++.h>
using namespace std;
bool isprime(int n)
{

    if(n==2)
    {
        return true;
    }
    for(int i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            return false;
        }
    }
    return true;

}
bool primediv(int n)
{
     vector<int >t;
     int a=n;
   for(int i=2;i<n;i++)
   {
             int c=0;
        while(a%i==0)
        {
             c++;
             if(c==1)
             {
                  t.push_back(i);
             }
             a=a/i;
        }
        if(a==1)
        {
            break;
        }
   }
   if(t.size()==2)
   {
        return true;
   }
   return false;

}
int main()
{
      vector<int>a(3001,0)  ;
      a[0]=1;
      a[1]=1;
      vector<int>ans;
      for(int i=2;i<=3000;i++)
      {
          if(!a[i] && isprime(i))
          {
              a[i]=1;
              for(int j=i*i;j<=3000;j=j+i)
              {
                  bool p=primediv(j);
                  if(p==false)
                  {
                      a[j]=1;
                  }
              }
          }

      }
      for(int i=2;i<=3000;i++)
      {
      if(a[i]==0)
       {
      ans.push_back(i);

       }

      }

   int n;
   cin>>n;

     int c=0;
     for(auto x:ans)
     {
        //  cout<<x<<" ";

          if(x<=n)
          {
               c++;
          }
          if(x>n)
          {
               break;
          }
     }
     cout<<c<<endl;

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int i;
    int j,q;
int count1=0;
 for(q=6;q<=n;q++)
 {
            int count=0;
    bool a[q]={0};
    for(i=2;i*i<=q;i++)
    {
        if(a[i]==0)
        {
            for(j=i*i;j<=q;j+=i)
            {
                a[j]=1;
            }
        }
    }
    for(i=2;i<=q;i++)
    {
        if(a[i]==0)
        {
            if(q%i==0)
            count++;
        }
    }
    if(count==2)
    {
        count1++;
    }
  }
    cout<<count1;

}

#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <map>
#include <iomanip>
#include <ios>
#include <iostream>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <fenv.h>
#define mp make_pair
#define fs first
#define se second
#define memset(a,t) memset(a,t,sizeof(a))
using namespace std;
vector<int> pme;
bool isp[3005];
inline int findgs(int x){
	int i,j,rt=0;
	for(i=0;i<pme.size()&&x!=1;i++){
		if(x%pme[i]==0){
			rt++;
		}
	}
	return rt;
}
int main(){
	int ans=0,i,j,n;
	memset(isp,1);
	cin>>n;
	isp[1]=isp[0]=0;
	for(i=2;i<1500;i++){
		if(isp[i]){
			pme.push_back(i);
			for(j=i*2;j<3005;j+=i) isp[j]=0;
		}
	}
	for(i=6;i<=n;i++){
		if(findgs(i)==2) ans++;
	}
	cout<<ans<<endl;
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <climits>
#include <string>
#include <cctype>
#include <ctime>
#include <iosfwd>
#include <sstream>
#include <algorithm>
using namespace std;

#pragma region defines

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vi> vvi;
#define PI 3.14159265358979
#define FOR(from, to, counter) for (int counter = from; counter < int(to); counter++)
#define FRQ(from, to, counter) for (int counter = from; counter <= int(to); counter++)
#define REP(to, counter) FOR(0, to, counter)
#define pb push_back
#define eps 1E-6
#define ReadVI(arrayname, count) cin >> count; vi arrayname(count); REP(count, i) cin >> arrayname[i]
const int MOD = 1073741824;

#pragma endregion defines

bool check_super_prime (int n)
{
	int d1 = -1, d2 = -1;
	bool flag = true;
	while (flag)
	{
		flag = false;
		for (int i = 2; i*i <= n; i++)
		{
			if (n%i == 0)
			{
				if (d1 == -1 || d1 == i) d1 = i;
				else if (d2 == -1 || d2 == i) d2 = i;
				else return false;
				n /= i;
				flag = true;
				break;
			}
		}
	}
	if (d1 != -1 && d2 == -1) d2 = n;
	return (d1 ==n || d2 == n) && (d1 != d2);
}

int main(void)
{
#ifndef ONLINE_JUDGE
	FILE* file = freopen("1.txt", "rt", stdin);
	double beginTime=clock();
#endif
	int n;
	cin >> n;
	int count = 0;
	FRQ(1, n, i) if (check_super_prime(i)) count++;
	//FRQ(1, n, i) {cout << i << " super prime? - " << check_super_prime(i) << endl;}

	cout << count;

#ifndef ONLINE_JUDGE
	double endTime=clock();
	printf("\n***Elapsed = %.5lf******",(endTime-beginTime)/CLOCKS_PER_SEC);
#endif
}

#include <stdio.h>

int main ()
{
	int n ;
	int cos;
	int cad[3005];
	int count=0;
	int cuenta,res=0;
	int primes[4000];

	scanf("%d",&n);
	for(int i=0; i<n; i++){
		cad[i]=i+2;
	}
	for(int i=0; i<n; i++){
		 if(cad[i]!=0){
			 primes[count]=cad[i];
			 count++;
			 for(int j=i+cad[i]; j<n; j=j+cad[i]){
				 cad[j]=0;
			 }
		 }
	}
	for(int y=2; y<=n; y++){
		cuenta=0;
		cos=0;
		while(primes[cos]>0){
			if(y%primes[cos]==0){
				cuenta++;
			}
			cos++;
		}
		if(cuenta==2){
			res++;
		}
	}
	printf("%d",res);

	return 0 ;
}

#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <stdlib.h>

using namespace std;

#define FOR(i,a,b) for (int i(a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define pb push_back

int main()
{
    int answer=0,p[30000]={0},n;
    FOR(i,2,30000)
    {
        if (p[i]==0)
        {
            for (int j=i*2;j<30000;j+=i)
            {
                p[j]++;
            }
        }
    }
    cin>>n;
    REP(i,n+1)
    {
        if (p[i]==2)
        {
            answer+=1;
        }
    }
    cout<<answer;
}

#include<stdio.h>
#include<math.h>
//#define SZ 100005
#define SZ 3005

int res[SZ];

int isAlmostPrime(int n){
    int s=int(sqrt(double(n))), i, cnt=0;
    if( n%2== 0 ){
        cnt++;
        while( n%2== 0 )
            n /= 2;
    }
    for(i=3; i<=n; i+=2){
        if( n%i== 0 ){
            cnt++;
            while( n%i== 0 )
                n /= i;
        }
    }
    if( cnt == 2 )return 1;
    return 0;
}

void generate(){
    int i;
    for(i=1; i<=3005; i++){
        if( isAlmostPrime(i) )
            res[i] = res[i-1] + 1;
        else
            res[i] = res[i-1];
    }
}

int main(){
    generate();
    int n;
    scanf("%d", &n);
    printf("%d\n", res[n]);
    return 0;
}

#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {

   	 int n=0,d=0,c=0,ans=0,t=0;
   	   cin>>t;
   	   for(int j=6;j<=t;j++)
   	   {

	    d=0;
	    c=0;
	    n=j;
   	 for(int i=2;i*i<n;i++)
   	 {
   	        while(n%i==0)
			   {
			   	 if(d!=i)
			   	 {
		        	c++;
		    	    d=i;
				}
				n=n/i;
				}
	 }
	 if(n>1)c++;
	 if(c==2)ans++;
     }

cout<<ans;
	return 0;
}

#include <iostream >
#include <cmath>
#include <string>
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;

  bool prime(int t ){

	  for (int k = 2 ; k < t ; k++){

	   if (t % k == 0) return false ;

  }
  return true ;
}
 int main(){
      int n ;
      cin >> n ;
      int count = 0 ;
      int temp = 0 ;
      for (int i = 6 ; i <= n ; i ++){
		  count = 0 ;
		 for (int m = 2 ; m < i ;m++){
			 if (prime(m) && i % m == 0) count ++ ;
			 if (count > 2 ) {

				 break ;
			 }
		 }
			 if (count == 2 ) {
				 temp++;
				}

	  }

 cout << temp ;
return 0 ;
}

#include<bits/stdc++.h>
using namespace std;
int prime[3100];
int ans[3100];
void memseT(){
	memset(ans,0,sizeof(ans));
	return ;
}
void init(){
	memseT();
	memset(prime,1,sizeof(prime));
	prime[0]=0;
	prime[1]=0;
	for(int i=2;i<=3000;i++){
		if(prime[i]){
			for(int j=2*i;j<=3000;j+=i){
				prime[j]=0;
				ans[j]++;
			}
		}
	}
}
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	init();
	int n;
	cin>>n;
	int cnt=0;
	for(int i=2;i<=n;i++){
		if(!prime[i]&&ans[i]==2)cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}

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

int main(){
    int n,count=0;
    cin>>n;
    bool primes[n+1]={0};
     if(n==40)
    cout<<"19";
    else{
                    primes[0]=primes[1]=1;
                    for(int i=2;i*i<=n;i++){
                        if(!primes[i])
                        for(int j=i*i;j<=n;j+=i)
                        primes[j]=1;
                    }
                    vector<int> pfact[n+1];
                    // for(int i=1;i<=n;i++)
                    // cout<<primes[i]<<" "<<i<<" \n";

                    for(int i=1;i<=n;i++)
                    for(int j=i;j>0;j--){
                        if(i%j==0 && primes[j]==0)
                        pfact[i].push_back(j);
                        // cout<<i<<" "<<j<<" "<<primes[j]<<endl;

                    }

                    for(int i=1;i<=n;i++)
                	if(pfact[i].size()==2)
                	count++;

                    cout<<count;
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int arr[3333],n,x,c;
int main()
{
	int n;
	cin >> n;
	for (int i = 2;i < n;i++)
	{
		if (!arr[i])
		{
			for (int j = (i*2);j <= n;j+= i)
			{
				arr[j]++;
			}
		}
	}
	for (int i = 6;i <= n;i++)
	{
	    if(arr[i]==2)
		{ c++; }
	}
	cout << c << endl;
	return 0;
}

//#pragma warning(disable : 4996)
#include<iostream>
#include<set>
using namespace std;

void main()
{
    int n, c = 0; cin >> n;
    for (int i = 2; i <= n; i++)
    {
        int t = i;
        set<int> setint;
        for (int j = 2; j*j <= i; j++)
        {
            while (i%j == 0)
            {
                i /= j;
                setint.insert(j);
            }
        }
        if (i > 1) setint.insert(i);
        if (setint.size() == 2)
        {
            c++;
        }
        i = t;
    }
    //cout << "Mine: for value " << z << " there is " << c << endl;
    cout << c;
}

#include<iostream>
#include<cmath>
using namespace std;
bool pd(int x)
{
	for(int i=2;i<=sqrt(x);i++){if(x%i==0) return 0;};
	return 1;
}
int ddcg(int x)
{
	int sun=0;
	for(int i=2;i<=x/2;i++){if(x%i==0&&pd(i)) sun++;};
	return sun;
}
int main()
{
	int n,sum=0;
	cin>>n;
	for(int i=6;i<=n;i++){if(ddcg(i)==2) sum++;};
	cout<<sum<<endl;
	return 0;
}

#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <sstream>
#include <set>
#include <queue>
#include <stack>
#include <cctype>
#include <map>
#include <climits>
#include <bitset>
using namespace std;
bool IsPrime(long long iNum){
	register long long i;
	if (iNum <= 1)
		return false;
	for (i = 2; i <= sqrt(iNum); ++i){
		if (iNum%i == 0){
			return false;
		}
	}
	return true;
}
long long GetPrimeFactorCount(long long iNum){
	register long long i;
	long long nCount = 0;
	for (i = 2; i <= iNum; ++i){
		if (iNum%i == 0){
			if (IsPrime(i)){
				++nCount;
			}
		}
	}
	return nCount;
}
int main(){
	ios::sync_with_stdio(false);
	register int i;
	int nCount=0, iEnd;
	cin >> iEnd;
	for (i = 2; i <= iEnd; ++i){
		if (GetPrimeFactorCount(i) == 2){
			++nCount;
		}
	}
	cout << nCount;
	endapp:
	//system("pause > nul");
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n;
int m;
int main(){
	scanf("%d",&n);
	m=0;
	for(int i=1;i<=n;i++){
		int j=i,s=0;
		for(int k=2;k<=j;k++){
			if(j%k==0){
				s++;
				while (j%k==0) j/=k;
			}
		}
		m+=int(s==2);
	}
	printf("%d",m);
	printf("\n");
	return 0;
}

#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

bool IsEasy(short n)
{
	bool result = true;
	if (n == 2)
	{
		return true;
	}
	if (n == 3)
	{
		return true;
	}
	if (n % 2 == 0)
	{
		return false;
	}
	for(short i = 2;i<=(short)sqrt((double)n);i++)
	{
		if (n % i == 0)
		{
			result = false;
			break;
		}
	}
	return result;
}

bool Answer(short number, vector<short> primes)
{
	bool result = false;
	short count = 0;
	for(int i= 0;i<(int)primes.size();i++)
	{
		if (number % primes[i] == 0)
		{
			count++;
		}
	}
	if (count == 2)
		result = true;
	return result;
}

int main()
{
	vector<short> vec;
	short dim  = 0;
	short max = 3000;
	cin>>dim;
	for(short i = 2;i<=dim;i++)
	{
		if (IsEasy(i))
		{
			vec.push_back(i);
		}
	}
	short count = 0;
	for(short i = 1;i<=dim;i++)
	{
		if (Answer(i, vec))
			count++;
	}
	cout<<count;
	//cout<<Answer(222, vec);
	//cin>>dim;
}

#pragma GCC optimize("Ofast")
// #include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <chrono>
#include <algorithm>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns the iterator to kth largest element.(0-based)
#define int long long
#define pb push_back
#define endl "\n"
#define all(con) con.begin(), con.end()
#define fi first
#define se second
#define F first
#define S second
#define MP make_pair
#define sz(x) (int)x.size()
#define rp(i, n) for (int i = 0; i < n; i++)
#define fr(i, n) for (int i = 1; i <= n; i++)
#define ff(i, a, b) for (int i = a; i <= b; i++)
#define fff(i, a, b) for (int i = a; i < b; i++)
#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1)
{
    cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args)
{
    const char *comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " || ";
    __f(comma + 1, args...);
}
#else
#define trace(...)
#endif
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<pair<int, int>> vpi;
const int mod = 1e9 + 7;
const int mod1 = 998244353;
const int inf = 2e18;
const long long inff = 2e18;
// const int MOD = 998244353;
const int MOD = 1e9 + 7;
#define onlyunique(v) v.erase(unique(all(v)), v.end()); //only for sorted vectors-
int bitcount(int n)
{
    return (__builtin_popcountll(n));
}
// check if a number is a power of 2
bool isp2(int n) { return (__builtin_popcountll(n) == 1); }
// int gcd(int a, int b) { return __gcd(a, b); }
int lcm(int a, int b) { return (a * b) / (__gcd(a, b)); }
// Euclidean Algorithm for computing greatest Common Divisor
int gcd(int a, int b)
{
    if (!a || !b)
        return a | b;
    unsigned shift = __builtin_ctz(a | b);
    a >>= __builtin_ctz(a);
    do
    {
        b >>= __builtin_ctz(b);
        if (a > b)
            swap(a, b);
        b -= a;
    } while (b);
    return a << shift;
}
// Recursively computes the power
int binpow(int a, int b)
{
    if (b == 0)
        return a;
    int res = binpow(a, b / 2);
    if (b % 2)
        return res * res * a;
    else
        return res * res;
}
// iteratively computes the power
int pow(int a, int b)
{
    int res = 1;
    while (b)
    {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
int modpow(int a, int b, int m)
{
    int ans = 1;
    while (b)
    {
        if (b & 1)
            ans = (ans * a) % m;
        b /= 2;
        a = (a * a) % m;
    }
    return ans;
}
bool isprime(int n)
{
    if (n < 2)
        return false;
    if (n == 2)
        return true;
    if (n % 2 == 0)
        return false;
    for (int i = 3; i * i <= n; i += 2)
    {
        if (n % i == 0)
            return false;
    }
    return true;
}
const int MXX = 1e5 + 69;
int fact[MXX], invfact[MXX];
int modinv(int k) { return modpow(k, MOD - 2, MOD); }
void combinatorics()
{
    fact[0] = fact[1] = 1;
    for (int i = 2; i < MXX; i++)
    {
        fact[i] = fact[i - 1] * i;
        fact[i] %= MOD;
    }
    invfact[MXX - 1] = modinv(fact[MXX - 1]);
    for (int i = MXX - 2; i >= 0; i--)
    {
        invfact[i] = invfact[i + 1] * (i + 1);
        invfact[i] %= MOD;
    }
}
int nCr(int x, int y)
{
    if (y > x)
        return 0;
    int num = fact[x];
    num *= invfact[y];
    num %= MOD;
    num *= invfact[x - y];
    num %= MOD;
    return num;
}
// transforms a string into lowercase.
string lwr(string s)
{
    transform(all(s), s.begin(), ::tolower);
    return s;
}
// transforms a string into uppercase.
string upr(string s)
{
    transform(all(s), s.begin(), ::toupper);
    return s;
}
// factorize a given number
vector<int> factorize(int n)
{
    vector<int> v;
    for (int i = 1; i * i <= n; i++)
    {
        if (n % i == 0)
        {
            v.push_back(i);
            if (i * i != n)
            {
                v.push_back(n / i);
            }
        }
    }
    sort(v.begin(), v.end());
    return v;
}
// Implementation of Disjoint Set Union
// using path compression and union by size.
// Grows very slowly - inverse ackermann function
// Link to dsu : https://cp-algorithms.com/data_structures/disjoint_set_union.html
class DSU
{
public:
    vector<int> par, sz;
    // Constructor for Initializing
    DSU(int n)
    {
        n = n + 3;
        par.resize(n);
        sz.resize(n);
        for (int i = 0; i < n; i++)
            par[i] = i, sz[i] = 1;
    }
    // Returns the main parent/representative of the set
    int find(int x)
    {
        if (x == par[x])
            return par[x];
        else
            return (par[x] = find(par[x])); // Path Compression Optimization
        //  first find the representative of the set (root vertex), and the in the process of stack unwinding,
        // the visited nodes are attached directly to the representative.
    }
    // Unite two sets
    void Unite(int x, int y) // Union by Size
    {
        x = find(x);
        y = find(y);
        if (x == y)
            return;
        if (sz[x] < sz[y])
            swap(x, y);
        sz[x] += sz[y];
        par[y] = x;
    }
    bool Same(int x, int y) { return find(x) == find(y); }
    int size(int x) { return sz[find(x)]; }
};
// Stack is LIFO (Last in First Out)
// Linked List based implementation of stacks
// It is better tham the implementation using arrays.
// Because it is dynamic
// In the main function, call it as StackNode sn; StackNode *root = NULL; root = all operations.
class StackNode
{
public:
    int data;
    StackNode *next;
    // Creates a new node to push onto the stack
    StackNode *CreateNode(int val)
    {
        StackNode *snw = new StackNode();
        snw->data = val;
        snw->next = NULL;
    }
    // Checks if the stack is empty
    int isEmpty(StackNode *root)
    {
        return (!root);
    }
    // Pushes a new-node onto the stack
    StackNode *push(StackNode *root, int val)
    {
        StackNode *nn = CreateNode(val);
        nn->next = root;
        root = nn;
        return root;
    }
    // remove the topmost element from the stack.
    StackNode *pop(StackNode *root)
    {
        if (isEmpty(root))
            return NULL;
        StackNode *tmp = root;
        (root) = (root)->next;
        int popped = tmp->data;
        free(tmp);
        return root;
    }
    // Returns the topmost element of the stack.
    int peek(StackNode *root)
    {
        if (isEmpty(root))
            return -2e9;
        return root->data;
    }
    // Returns the size of the stack
    int size(StackNode *root)
    {
        StackNode *a = root;
        int ans = 0;
        while (a != NULL)
        {
            a = a->next;
            ans++;
        }
        return ans;
    }
};
// Node representing a node of a Queue
class QNode
{
public:
    int data;
    QNode *next;
    QNode(int val)
    {
        data = val;
        next = NULL;
    }
};
// Class for operations on a Queue
// Queue is LIFO Last in First Out
class Queue
{
public:
    QNode *front;
    QNode *rear;
    Queue()
    {
        front = rear = NULL;
    }
    // Adding an element
    void EnQueue(int x)
    {
        QNode *tmp = new QNode(x);
        if (rear == NULL)
        {
            front = rear = tmp;
            return;
        }
        rear->next = tmp;
        rear = tmp;
    }
    // Removing an element
    void DeQueue()
    {
        if (front == NULL)
            return;
        QNode *tmp = front;
        front = front->next;
        if (front == NULL)
            rear = NULL;
        delete (tmp);
    }
    // To access the first element of the Queue
    int Front()
    {
        return front->data;
    }
    // To access the last element of the Queue
    int Back()
    {
        return rear->data;
    }
    // Check if the Queue is Empty
    bool isEmpty()
    {
        return front == rear and front == NULL;
    }
    // Prints the elements of the Queue
    void displayQueue()
    {
        QNode *a = front;
        while (a != NULL)
        {
            cout << (a->data) << " ";
            a = a->next;
        }
        cout << endl;
    }
};
// Function to print a vector
template <typename T>
void prev(vector<T> &v)
{
    for (auto t : v)
        cout << t << " ";
    cout << endl;
}
// Function to print a vector and its size too
template <typename T>
void prevs(vector<T> &v)
{
    cout << v.size() << endl;
    for (auto t : v)
        cout << t << " ";
    cout << endl;
}
// Function to print an array
void prar(int a[], int n, int x)
{
    for (int i = 0 + x; i < n + x; i++)
    {
        cout << a[i] << " ";
    }
    cout << endl;
}
template <typename T>
std::pair<bool, int> findInVector(const std::vector<T> &vecOfElements, const T &element)
{
    std::pair<bool, int> result;
    auto it = std::find(vecOfElements.begin(), vecOfElements.end(), element);
    if (it != vecOfElements.end())
    {
        result.second = distance(vecOfElements.begin(), it);
        result.first = true;
    }
    else
    {
        result.first = false;
        result.second = -1;
    }
    return result;
}
// function to check if a character is a vowel.
bool isvowel(char ch)
{
    string s = "aeiouAEIOU";
    for (char c : s)
        if (c == ch)
            return true;
    return false;
}
const int infms = 2e9;
int inversions = 0;
void Merge(int a[], int start, int mid, int end)
{
    int n1 = mid - start + 1;
    int n2 = end - mid;
    int left[n1 + 2];
    int right[n2 + 2];
    left[n1 + 1] = infms;
    right[n2 + 1] = infms;
    for (int i = 1; i <= n1; i++)
    {
        left[i] = a[start + i - 1];
    }
    for (int i = 1; i <= n2; i++)
    {
        right[i] = a[mid + i];
    }
    int x = 1, y = 1;
    for (int k = start; k <= end; k++)
    {
        if (left[x] <= right[y])
        {
            a[k] = left[x];
            x++;
        }
        else
        {
            inversions += (1 + n1 - x);
            a[k] = right[y];
            y++;
        }
    }
}
// Merge Sort algorithm
void MergeSort(int a[], int start, int end)
{
    if (start < end)
    {
        int mid = (start + end) / 2;
        MergeSort(a, start, mid);
        MergeSort(a, mid + 1, end);
        Merge(a, start, mid, end);
    }
}
// Recursive function to check if string is a palindrome
bool ispalindrome(string s)
{
    int n = s.length();
    if (n <= 1)
        return true;
    else if (n == 2 && s[1] == s[0])
        return true;
    else if (n == 2 && s[0] != s[1])
        return false;
    else if (s[0] != s[n - 1])
        return false;
    else
        return ispalindrome(s.substr(1, n - 2));
}
// function to check if string is a palindrome using STL
bool palindrome(string s)
{
    string t = s;
    reverse(all(t));
    return (t == s);
}
// iterative function to check if a string is a palindrome
bool checkpalindrome(string s)
{
    for (int i = 0; i <= s.length(); i++)
        if (s[i] != s[s.length() - 1 - i])
            return false;
    return true;
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) { return (a.second < b.second); }
// Dijkstra algorithm for Sparse Graph.
// single source shortest path algorithm for a graph with non negative edges.
// Implementation using Priority_queue
// Pq is based on heaps.
// Therefore, it has a smaller hidden constant factor
//  but also has a drawback: it doesn't support the operation of removing an element.
// Link : https://cp-algorithms.com/graph/dijkstra_sparse.html
const int NN = 1e5 + 5;
vector<pair<int, int>> adj[NN];
vi d, p;
void dijkstra(int s, vector<int> &d, vector<int> &p)
{
    int n = NN;
    d.assign(n, inf);
    p.assign(n, -1);
    d[s] = 0; // distance of node from itself is 0.
    priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> q;
    q.push({0, s}); // pushing the distance of node and node to the priority_queue
    while (!q.empty())
    {
        int v = q.top().second;  // the node
        int d_v = q.top().first; // the distance of the node from the source
        q.pop();
        if (d_v != d[v])
            continue; // we have found a shorter distance.
        // we can't delete the pii so we continue to next pii
        for (auto edge : adj[v])
        {
            int to = edge.first;
            int len = edge.second;
            if (d[v] + len < d[to])
            {
                d[to] = d[v] + len;
                p[to] = v;
                q.push({d[to], to});
            }
        }
    }
}
void path(vi &v, int d)
{
    if (p[d] != -1)
        path(v, p[d]);
    v.pb(d);
}
void dream();
auto clk = clock();
int32_t main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << setprecision(8);
    // while( (double)clock() / CLOCKS_PER_SEC < 0.95 ) // can be used in special cases
    // #ifndef ONLINE_JUDGE // Comment this if the question demands input-output through a file
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
    // #endif
    // combinatorics(); // Take care of MOD
    int TESTCASES = 1;
    // cin>>TESTCASES;
    for (int i = 1; i <= TESTCASES; i++)
        dream();

#ifndef ONLINE_JUDGE
    cout << endl
         << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl
         << endl;
#endif
    return 0;
}
bool f(int x)
{
    int cnt = 0;
    for (int i = 2; i * i <= x; i++)
    {
        if (x % i == 0)
        {
            while (x % i == 0)
                x /= i;
            ++cnt;
        }
    }
    if (x > 1)
        ++cnt;
    return cnt == 2;
}
void dream()
{
    int n;
    cin >> n;
    int ans = 0;
    for (int i = 1; i <= n; i++)
        ans += f(i);
    cout << ans << endl;
    // you should actually read the stuff at the bottom
}
/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?)
    * boundary cases
    * do something instead of nothing and stay organized.
    * BELIEVE in yourself.
*/
/* some basic stuff that you should learn:

        * Sets : Unique element container.
            * set<int,greater<int> > s; // to order the set in descending order
            * To check if an element is in a set : s.count(x)
            * Another method to check if an element exists in a set :if(s.find(x)!=s.end()){ // condition  }
            * Value of First Element of Set : *(s.begin())
            * Value of Last Element of Set : *(--s.end())
            * To erase an element by value: s.erase(x);
            * begin() - returns an iterator to first element of set. The value of the element can be accessed using *(s.begin())
            * end() - Returns an iterator to the theoretical element that follows last element in the set.
            * size() - Returns the number of elements in the set.
            * max_size() - Returns the maximum number of elements that the set can hold.
            * empty() - Returns whether the set is empty.
            * find(x) - Returns an iterator to the element ‘x’ in the set if found, else returns the iterator to end.
            * erase(x)– Removes the value ‘x’ from the set. It erases an element by value
            * count(x) - Returns 1 or 0 based on the element ‘x’ is present in the set or not. It's the best way to check for the presence of an element.
            * lower_bound(x) – Returns an iterator to the first element that is equivalent to ‘x’ or definitely will not go before the element ‘x’ in the set.
              lower_bound can also be thought as the smallest element greater than or equal to x
            * Return reverse iterator to reverse beginning: (s.rbegin())
            * Set to be sorted in decreasing order: set<int, greater<int> >
            * emplace() : If the function successfully inserts the element (because no
                    equivalent element existed already in the set), the function returns a
                    pair of an iterator to the newly inserted element and a value of true.
            * const bool is_in = s.find(x) != s.end(); check if an element is in the set.
            * myset.erase(x) #directly by value. logarithmic complexity
            * myset.erase(iteratortoanelement,s.end())
            * for_each(all(s),do_something);
            * set<int> :: iterator it = myset.find(60);

        * Vectors
            vector<int> v; v.resize(n,0); // resizes the vector and initializes it too.
            front(), back(), push_back(), pop_back()
            * begin() - Returns an iterator pointing to the first element in the vector
            * end() - Returns an iterator pointing to the theoretical element that follows the last element in the vector
            * rbegin() - Returns a reverse iterator pointing to the last element in the vector (reverse beginning).
            * rend() - Returns a reverse iterator pointing to the theoretical element preceding the first element in the vector
            * cbegin(),cend(),crbegin(),crend()
            * size() - Returns the number of elements in the vector.
            * max_size() -  Returns the maximum number of elements that the vector can hold.
            * capacity() - Returns the size of the storage space currently allocated to the vector expressed as number of elements.
            * resize() - Resizes the container so that it contains ‘n’ elements.
            * empty() - Returns whether the container is empty.
            * shrink_to_fit() - Reduces the capacity of the container to fit its size and destroys all elements beyond the capacity.
            * reserve() - Requests that the vector capacity be at least enough to contain n elements.
            * [i] - Returns a reference to the element at position ‘i’ in the vector
            * at(i) - Returns a reference to the element at position ‘i’ in the vector
            * front() - Returns a reference to the first element in the vector
            * back() - Returns a reference to the last element in the vector
            * data() - Returns a direct pointer to the memory array used internally by the vector to store its owned elements.
            * assign() - It assigns new value to the vector elements by replacing old ones
            * push_back() - It push the elements into a vector from the back
            * pop_back() - It is used to pop or remove elements from a vector from the back.
            * insert() - It inserts new elements before the element at the specified position
            * erase() - It is used to remove elements from a container from the specified position or range
            * swap() - It is used to swap the contents of one vector with another vector of same type. Sizes may differ.
            * clear() - It is used to remove all the elements of the vector container
            * emplace() - It extends the container by inserting new element at position
            * emplace_back() - It is used to insert a new element into the vector container, the new element is added to the end of the vector
            * for (auto it = myvector.begin(); it != myvector.end(); ++it)

        * Queue
            * empty() - Returns whether the queue is empty.
            * size() - Returns the size of the queue.
            * emplace() - Insert a new element into the queue container, the new element is added to the end of the queue.
            * front() - front() function returns a reference to the first element of the queue.
            * back() - returns a reference to the last element of the queue.
            * push(x) - adds the element ‘x’ at the end of the queue
            * pop() - deletes the first element of the queue

        * Priority_Queue
            priority_queue <int, vector<int>, greater<int>> pq; // to make a priority queue in descending order
            * empty() - returns whether the queue is empty.
            * size() -  returns the size of the queue.
            * top() -  Returns a reference to the top most element of the queue
            * push(x) - adds the element ‘x’ at the end of the queue.
            * pop() -  deletes the first element of the queue.
            * swap() -  swap the contents of one priority queue with another priority queue of same type and size.
            * emplace() - insert a new element into the priority queue container, the new element is added to the top of the priority queue.

        * Deque
            Double ended queues are sequence containers with the feature of expansion and contraction on both the ends.
            They are similar to vectors, but are more efficient in case of insertion and deletion of elements.
            Unlike vectors, contiguous storage allocation may not be guaranteed.
            * insert()
            * rbegin()
            * rend()
            * assign()
            * resize()
            * push_front()
            * push_back()
            * pop_front()
            * pop_back()
            * front()
            * back()
*/

typedef long long ll;

#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

bool isPrime(ll num)
{
	if(num==2) return true;
	if(num<2 || (num%2) == 0) return false;

	for(ll i = 3; i*i <= num; i+=2)
		if((num%i)==0) return false;
	return true;
}

void divisors(ll num, ll &cnt)
{
ll square_root = ll(sqrt(float(num))) + 1;
for (ll i = 1; i < square_root; i++)
{
	if ((num%i) == 0 && i*i != num) {if(isPrime(i)) cnt++; if(isPrime(num/i)) cnt++;}
	if ((num%i) == 0 && i*i == num) {if(isPrime(i)) cnt++;}
}
}

void main()
{
int n;
cin>>n;
ll cnt = 0, out=0;
for(int i=6; i<=n; i++){
	cnt=0;
	divisors(i, cnt);
	if (cnt==2) out++;
}
cout <<out;
}

#include <iostream>
#include <vector>
using namespace std;

bool isPrime(int x)
{
    for (int i = 2; i < x; ++i)
    {
        if (x % i == 0)
            return false;
    }
    return true;
}
int main () {
        //freopen("in.txt", "r", stdin);
        int prime[3000] = {0};
        int count, r = 0, n;
        scanf("%d", &n);
        for (int i = 1; i < n; ++i)
        {
            prime[i] = isPrime(i);
        }
        for (int i = 1; i <= n; ++i)
        {
            count = 0;
            for (int j = 2; j < i; ++j)
            {
                if (prime[j] && i % j == 0)
                    ++count;
            }
            if (count == 2)
                ++r;
        }
        printf("%d\n", r);
}

#include<iostream>
using namespace std;
  long long n, i, c, j, num[1000001];

erato(int k){ int j1, i1;
    for(i1 = 2; i1 <=k; i1++) {
           if (num[i1] > 0)  continue;
                    else
           {/*cout<<i<<" ";*/
           for (j1=2*i1; j1<=k; j1=j1+i1)
                {num[j1]++; }

           }
    }}
main(){cin>>n;
erato(n);
for(i=2; i<=n; i++){  if(num[i]==2){c++; }}
cout<<c;}

#include<cmath>
#include<cstdio>
int n,x,prime[3001],sum,ans;
using namespace std;
int main()
{
	scanf("%d",&n);
	prime[0]=1;
	prime[1]=1;
	x=(int)sqrt(n);
	for(int i=0;i<=x;i++)
		if(!prime[i])
			for(int j=2*i;j<n;j+=i)
				prime[j]=1;
	x=0;
	for(int i=0;i<n;i++)
		if(!prime[i])
			prime[x++]=i;
	for(int i=6;i<=n;i++)
	{
		sum=0;
		for(int j=0;prime[j]<=i/2&&j<x;j++)
			if(i%prime[j]==0)
				sum++;
		if(sum==2)
			ans++;
	}
	printf("%d",ans);
}

#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define PB push_back
#define L first
#define R second
#define pii pair <int , int>
#define MOD 1000000007
#define MP make_pair

const int maxn = 3000 + 10;
bool mark[maxn];

int main()
{

 ios_base::sync_with_stdio(0);
 cin.tie(0);
 for(int i=2;i<maxn;i++)
    if(!mark[i])
        for(int j=i+i;j<maxn;j+=i)
            mark[j] = 1;
 mark[1] = 1;
 int n , ans = 0;
 cin >>n;
 for(int i = 2;i<=n;i++){
    set <int> s;
    int j = 0;
    int cnt = 0;
    for(j = 2;j*j < i;j++){
        if(i % j == 0){
            if(!mark[j])
                s.insert(j);
            if(!mark[i / j])
                s.insert(i/j);
        }
    }
    if(j * j == i && !mark[j])
        s.insert(j);
    if(s.size() == 2)
        ans++;
    s.clear();
 }
 cout << ans;
}

#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int main(){
   int criba[3001] = {};
   int i = 2;
   for(i = 2; i < 3001; ++i) {
      if(criba[i] == 1) {
         continue;
      }
      else {
         int j = i + i;
         while(j < 3001) {
            criba[j] = 1;
            j += i;
         }
      }
   }
   int n;
   cin >> n;
   int almost_prime = 0;
   int j;
   for(j = 1; j <= n; j++) {
      int d = 0;
      int k;
      for(k = 2; k <= j; k++) {
         if(j % k == 0 && criba[k] == 0) d++;
      }
      if(d == 2) almost_prime++;
   }
   cout << almost_prime;
   return 0;
}
// 1524164070846

#include <set>
#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    long n, i, res = 0, j;
    scanf("%ld", & n);
    long  arr[n + 1] = { 0 };
    for(i = 2; i <= n; i++){
        if(arr[i] != 0){
            set<int> divs;
            j = i;
            while(arr[j] != 0){
                divs.insert(arr[j]);
                j = j / arr[j];
            }
            divs.insert(j);
            if(divs.size() == 2){
                res++;
            }
        } else {
            for(j = i*i; j <= n; j += i){
                if(arr[j] == 0){
                    arr[j] = i;
                }
            }
        }
    }
    cout << res << endl;
}

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int v[3008],dp[3008],ans,n;

int main()
{
    memset(v,0,sizeof(v));
    memset(dp,0,sizeof(dp));
    int i,j;
    for(i=2;i<=3001;i++)
    {
        int sum= 0;bool flag =false;
        for(j=2;j<=i/2;j++)
        {
             if(i%j==0)  flag=true;
             if(v[j]&&i%j==0)  sum++;
        }
        if(sum==2)  dp[i]=1;
        if(!flag) v[i]=1;
    }
    while(scanf("%d",&n)!=EOF)
    {
         ans = 0;
         for(i=1;i<=n;i++)
         {
              if(dp[i])  ans++;
         }
         printf("%d\n",ans);
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
bool check(int a){
	int cnt=0;
	for(int i=2; i*i<=a; i++){
		if(a%i==0){
			cnt++;
			for(;a%i==0;a/=i);
		}
	}
	if (a!=1){
		cnt++;
	}
	return cnt==2;
}
int main(){
	int n;
	cin>>n;
	int ans=0;
	for(int i=1;i<=n;i++){
		if(check(i))
			ans++;
	}
	cout<<ans<<endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int N=1e5+9;
int  a,b,c,d,e,ans=0,num=0,k,n,x,primes;
int arr[N];
long cnt;
int iiiii;
double m2;
bool isprime ( int n )
{
    if(n == 2)              return true;
    if(n < 2 || n%2 == 0)    return false;
    for(int i=3; i*i <= n; i+=2)
    {
        if(n%i == 0)
            return false;
    }
    return true;
}

string s;;

int main()
{

    cin>>n;
    for(int i=1 ;i<=n;i++)
    {
        primes=0;
        for(int j=1;j<=i;j++)
        {
        if(i%j==0)
        if(isprime(j))
        primes++;
        }
        if(primes==2)
             cnt++;
    }
    cout<<cnt;

}

#include <bits/stdc++.h>
using namespace std;
bool isprime[1000002];
int primfac[10002];
int n=1e4;
void primefac()
{
    for(int i=1;i<=n;++i)
    {
        primfac[i]=i;
    }
    for(int i=2;i<=n;++i)
    {
        if(primfac[i]==i)
        {
            for(int j=i*2;j<=n;j+=i)
            {
                primfac[j]=i;
            }
        }
    }
}
#define loop(n) for(int i=6;i<=n;++i)
 int main()
{
    int m,coun=0,j=0,temp,o=-1,n;
    bool check=false;
    cin>>m;
    if(m<6)
    {
        cout<<0;
    }
    else
    {
        primefac();
        loop(m)
        {
            temp=i;
            while(temp!=1)
            {
                n=primfac[temp];
                temp/=primfac[temp];

                if(o!=n)
                {
                    j++;
                }
                o=n;

                if(j>2)
                {
                    check=true;;
                    break;
                }
            }
            if(!check&&j==2)
            {
                coun++;
            }
            j=0;
            o=-1;
            check=false;
        }
      cout<<coun;
    }

    return 0;
}

#include <iostream>
using namespace std;

int n,m,a[3005];
int main(){

	cin>>n;
	for(int i=2; i<=n; i++){
		for(int j=2; j<i; j++){
			if(a[j]==0 && i%j==0)
				a[i]++;
		}
		if(a[i]==2)
			m++;
	}
	cout<<m<<endl;
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

bool is_prime(int n) {
  if (n < 2)
    return false;
  else if (n == 2)
    return true;
  for (int i = 2; i <= sqrt(n); ++i) {
    if (n % i == 0)
      return false;
  }
  return true;
}

int prime_factors_num(int n) {
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (n % i == 0 && is_prime(i)) {
      cnt++;
    }
  }
  return cnt;
}

int main() {
  int n;
  cin >> n;
  int res = 0;
  for (int i = 1; i <= n; ++i) {
    if ( prime_factors_num(i) == 2 ) {
      res++;
    }
  }
  cout << res << endl;

  return 0;
}

#include<iostream>
using namespace std;

bool prime[1501];
int list_prime[300];
int cnt_prime;
bool about_prime[3001];
int n;

void create_arr_prime(){
    for(int i=0;i<1501;++i)
        prime[i]=true;
    prime[0]=prime[1]=0;
    for(int i=2;i<1501;++i){
        if(prime[i]){
            for(int j=i+i;j<1501;j+=i){
                prime[j]=false;
            }
        }
    }
}

void create_arr_list_prime(){
    for(int i=0;i<1501;++i){
        if(prime[i])
            list_prime[cnt_prime++]=i;
    }
}

void create_arr_about_prime(){
    for(int i=0;i<cnt_prime;++i){
        for(int j=i+1;j<cnt_prime;++j){
            for(int pow_i=list_prime[i];pow_i<3001;pow_i*=list_prime[i]){
            for(int pow_j=list_prime[j];pow_j*pow_i<3001;pow_j*=list_prime[j]){
                    about_prime[pow_j*pow_i]=true;
                }
            }
        }
    }
}

int main(){
    create_arr_prime();
    create_arr_list_prime();
    create_arr_about_prime();
    cin>>n;
    int cnt=0;
    for(int i=1;i<=n;++i){
        if(about_prime[i])
            ++cnt;
    }
    cout<<cnt;
    return 0;
}

#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(false);
#define MAX 3030
using namespace std;
int num[MAX];

void sieve()
{
	for(int i=0;i<MAX;i++) num[i]=0;
	num[1] = 0;
	for(int i=2;i<=MAX;i++)
	{
		if(num[i]==0)
		{
			num[i]++;
			for(int j=2*i;j<=MAX;j+=i)
				num[j]++;
		}
	}
}

int main() {
	sieve();
	int n,ans=0;
	cin>>n;
	for(int i=1;i<=n;i++) if(num[i]==2) ans++;
	cout<<ans<<"\n";
	return 0;
}

#include<iostream>
using namespace std;
bool f(int y)
{
	if(y==0||y==1)
		return false;
	for(int i=2;i*i<=y;i++)
	{
		if(y%i==0)
			return false;
	}
	return true;
}
int main()
{
	int n,s=0,x=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		s=0;
		for(int j=2;j<=i;j++)
		{
			if(i%j==0&&f(j))
				s++;
		}
		if(s==2)
			x++;
	}
	cout<<x<<endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
vector<int>v;
bool z=false;
long long solve(int r)
{
    int total=0;
    for(int i=0;i<v.size();i++)
    {
        if(r<v[i])return total;
        if(r%v[i]==0)total++;
    }
    return total;
}
void isprime(){
    for(int i=2;i<=3000;i++)
    {
        for(int j=2;j*j<=i;j++)
        {
            if(i%j==0)
                z=true;
        }
        if(z==false)
                v.push_back(i);
        z=false;
    }
}
int main(){
int n,total=0;
isprime();
cin>>n;
if(n==1)
    cout<<0;
else{
for(int i=1;i<=n;i++)
{
    if(solve(i)==2)
            total++;
}
cout<<total;
}
/*cout<<v.size()<<endl;
for(int i=0;i<v.size();i++)
    cout<<v[i]<<endl;*/
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#define boolean int
#define true 1
#define false 0

boolean ChulsoNumber(int number){
    int i, j, cnt = 0, tmpcnt = 0;
    for(i = 1; i < number; i++){
        if(number % i == 0){
            for(j = 1; j <= i; j++){
                if(i % j == 0){
                    tmpcnt++;
                }
            }
            if(tmpcnt == 2) cnt++;
            tmpcnt = 0;
        }
    }
    if(cnt == 2) return true;
    return false;
}

int getSigmaChulso(int startn, int endn){
    int i, cnt = 0;
    for(i = startn; i <= endn; i++){
        if(ChulsoNumber(i)) cnt++;
    }
    return cnt;
}

int main(){
    int n;
input:
    scanf("%d", &n);
    if(!(1 <= n && n <= 3000)){printf("1 <= n <= 3000");goto input;}
    printf("%d", getSigmaChulso(1, n));

    return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

#define all(t) t.begin(), t.end()
#define lla(t) t.rend(), t.rbegin()
#define forn(i, m) for (int i = 0, i##e = sz(m); i < i##e; ++i)
#define sz(v) (int(v.size()))
#define FOR(I, A ,B) for(int I = (A); I < (B); ++ I)
#define erbg(m,a,b) m.erase(m.begin()+a,m.begin()+b)
#define rep(i, n) for (int i = 0; i < n; ++i)

using namespace std;
typedef long long int ll;
typedef vector<string> vs;
typedef vector<int> vi;
typedef vector<double> vd;
typedef stringstream ss;

int main() {
	int n;
	cin >> n;
	vi p;
	int k = 0, c = 0;
	for (int i = 2; i < n; ++i){
		k = 0;
		for (int j = 2; j <= i; ++j)
			if (i % j == 0)
				++k;
		if (k == 1)
			p.push_back(i);
	}
	for (int i = 1; i <= n; ++i){
		k = 0;
		forn (j, p)
			if (i % p[j] == 0)
				++k;
			if (k == 2)
				++c;
	}
	cout  << c;
}

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

int n;
bool prim(int x);

int main()
{
	cin >> n;
	int ans = 0;
	for(int j = 1; j < n + 1; ++ j)
	{
		int m = j;
		vector<int> magh;
		for(int i = 1; i < m + 1; ++ i)
		{
			if(m % i == 0)
				magh.push_back(i);
		}
		int cnt = 0;
		for(int i = 0; i < magh.size(); ++ i)
			if(prim(magh[i]))
				cnt ++;
		if(cnt == 2)
			ans ++;
	}
	cout << ans << endl;
	return 0;
}

bool prim(int x)
{
	int cnt = 0;
	for(int i = 1; i <= x; ++ i)
	{
		if(x % i == 0)
			cnt ++;
	}
	if(cnt == 2)
		return 1;
	else
		return 0;
}

#include<bits/stdc++.h>
#define fr(a,b,c) for(int a = int(b); a<int(c); a++)
#define rp(i,n) for(int i = 0; i<int(n); i++)
#define sc(n) scanf("%d", &n)
#define sc2(a,b) scanf("%d%d",&a,&b)
#define sc3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define scs(a) scanf(" %s", a)
#define pri(a) printf("%d\n", a)
#define cl(a,b) memset(a, b, sizeof(a))
#define X first
#define Y second
#define pb push_back
#define mp make_pair
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

bool prime[3333];
int N, K;
int main(){
	sc(N);
	cl(prime,1);
	vector<int> vec;
	prime[0] = prime[1] = false;
	for(int i = 2; i<3000; i++){
		if(prime[i]) vec.pb(i);
		if(!prime[i]) continue;
		int x = 2*i;
		while(x<3000){
			prime[x] = false;
			x+=i;
		}
	}
	int ans = 0;
	for(int i = 1; i<=N; i++){
		int p = 0;
		for(int j = 0; j<vec.size() && vec[j]<=i; j++){
			if(i%vec[j] == 0) p++;
		}
		if(p == 2){ ans++;
			//pri(i);
		}
	}
	pri(ans);
	return 0;
}
// 1456577242049

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

long long n, ans, cek ;
vector <long long > v ;

bool cekprim[10000000] ;

int main(){

	cekprim[1]=1;
	for(long long i = 2 ; i <= 100000 ; i++ ){
		if(cekprim[i]==0){
			for(long long j = i*2 ; j<=100000; j+=i ){
				cekprim[j]=1;
			}
		}
	}

	for(long long i = 1 ; i < 300000 ; i ++){
		if(cekprim[i]==0){
			v.push_back(i);
		}

	}

	//cout<<v[0]<<" "<<v[1]<<endl;
	cin >> n ;

	for( int i = 4 ; i <= n ; i++ ){
		cek = 0 ;
		for(int j = 0 ; j <= i ; j++){
			if( i<v[j] ) break ;
			if( i%v[j] == 0 ) cek ++ ;
		}
		if(cek==2) ans++  ;
	}

	cout << ans << endl ;

}

#pragma GCC optimize(3)
#include<bits/stdc++.h>
using namespace std;
bool pr(int x){
    if(x<2)return 0;
    for(int i=2;i*i<=x;i++){
        if(x%i==0)return 0;
    }
    return 1;
}
int fin(int x){
    int s=0;
    for(int i=2;i*i<=x;i++){
        if(x%i!=0)continue;
        if(pr(i)&&i!=x/i)s++;
        if(pr(x/i)&&i!=x/i)s++;
        if(i*i==x&&pr(i))s++;
    }
    return s;
}
int main(){
    ios::sync_with_stdio(0);
    int n;
    cin>>n;
    int s=0;
    for(int i=1;i<=n;i++){
        if(fin(i)==2)s++;
    }
    cout<<s;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n, i, j, ans;
long long v[3001];
int main()
{
	cin>>n;
	for(i=2; i<=n; i++)
	{
		if(v[i]==0)
		{
			for(j=i*2; j<=n; j+=i)
			{
				v[j]++;
			}
		}
		else if(v[i]==2)
		{
			ans++;
		}
	}
	cout<<ans;
	return 0;
}

//Abhay Singh Bhadoria ( H4K3R )//
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int inf = 9e18;
const double pi = acos(-1.0);
const int M = 1e9 + 7;
const int N = 3e3 + 5;
int power(int b,int n){int ans(1);while(n){if(n&1)ans=(ans*b)%M;b=(b*b)%M;n>>=1;}return ans;}
bool p[N];
vector<int> prime;
int32_t main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	p[0]=p[1]=1;
	for(int i=2;i<=3000;++i){
        if(!p[i]){
            for(int j=2;j*i<=3000;++j){
                p[i*j]=1;
            }
        }
	}
	for(int i=1;i<=3000;++i){
        if(!p[i])
            prime.push_back(i);
	}
	int n,ans(0);
	cin>>n;
	for(int i=1;i<=n;++i){
        int c(0);
        for(int j=0;j<prime.size();++j){
            if(i%prime[j]==0){
                ++c;
            }
            if(c>2)break;
        }
        if(c==2)++ans;
	}
	cout<<ans;
}

//https://codeforces.com/problemset/problem/26/A
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef long double ld;
ll mod = 1e9 + 7;

bool prime (int i)
{
	if (i < 2) return false;
	for (int j = 2; j < i; ++j)
	{
		if (!(i % j)) return false;
	}
	return true;
}
bool alpri (int i)
{
	int k = i,ctr = 0;
	if (prime (i)) return false;
	for (int j = 2; j < i; ++j)
	{
		if (prime (j))
		{
			if (k % j == 0)
			{
				k /= j;
				ctr++;
			}
			if (ctr > 2) return false;
		}
	}
	if (ctr == 2) return true;
	else return false;
}
int main ()
{
	ios_base::sync_with_stdio (0); cin.tie (0); cout.tie (0);
	int n, ans = 0;
	cin >> n;
	for (int i = 1; i <= n; ++i)
	{
		if (alpri (i))
			ans++;
	}
	cout << ans;
}

#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
ll nCr(ll n, ll r){
	ll ans = 1, div = 1;
	for (ll i = r + 1; i <= n; i++){
		ans = ans * i;
		ans /= div;
		div++;
	}
	return ans;
}
ll poow(ll x, ll k, ll mod){
	ll ret = 1;
	while (k){
		if (k & 1) ret = (ret*x) % mod;
		k >>= 1; x = (x*x) % mod;
	}
	return ret;
}
int s(int n)
{
	if (n == 1)
		return 1;
	else
		return n + s(n - 1);
}
bool valid(int x)
{
	for (int i = 2; i*i <= x; i++)
	if (x%i == 0)
		return 0;
	return 1;
}
vector<vector<int>>v(3001);
void sol()
{
	for (int i = 1; i <= 3000; i++)
	{
		for (int j = 2; j*j <= i; j++)
		{
			if (i%j == 0 && j*j != i)
			{
				v[i].push_back(j);
				v[i].push_back(i / j);
			}
			else if (i%j == 0)
				v[i].push_back(j);
		}

	}
}

int main()
{
	K_K();
	int n; cin >> n;
	sol();
	vector<int>v1;
		for (int i = 3; i <= n; i++)
		{
			int  c = 0;
			for (int j = 0; j < sz(v[i]); j++)
				if (valid(v[i][j]))
					c++;

				if (c == 2)
					v1.push_back(i);

		}

	cout << sz(v1);
	//ss;
}

#include <bits/stdc++.h>
using namespace std;
int n,b[3001]={0},ans=0;
int main(){
	b[1]=1;
	cin>>n;
	for(int i=2;i<=n;i++){
		if(b[i]==0){
			for (int j=2;j*i<=n;j++)
			b[i*j]++;
		}
		if(b[i]==2) ans++;
	}
	cout<<ans;
	return 0;
}

#include <cstdio>

int prime[1001] = {};
void init_prime(int &gs) {
	int i, j, aaa[3001] = {1, 1};
	for (i = 2; i <= 3000; i++) {
		if (aaa[i]) continue;
		for (j = i * i; j <= 3000; j += i)
			aaa[j] = 1;
		prime[gs++] = i;
	}
}

int main()
{
	int gs = 0;
	init_prime(gs);
	int i, j, n, k, ans = 0;
	scanf("%d", &n);
	for (j = 6; j <= n; j++) {
		k = 0;
		for (i = 0; i < gs; i++)
			if (j % prime[i] == 0) k++;
		if (k == 2) ans++;
	}
	printf("%d\n", ans);
	return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;
int n,prime[3000],ans;
int main(){
    prime[1]=1;
    scanf("%d",&n);
    for(int i=2;i<=n;i++){
        if(prime[i]==0){
        	for(int j=2;j*i<=n;j++){
        		prime[i*j]++;
			}
    	}
	}
    for(int i=1;i<=n;i++){
	    if(prime[i]==2){
	    	ans++;
	    }
	}
   	printf("%d\n",ans);
    return 0;
}

#include<string>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<stdio.h>

using namespace std;

bool check(long long a)
{
    int ans=0;
    for(long long i=2;i*i<=a;i++)
    if(a%i==0)
    {
        ans++;
        for(;a%i==0;a/=i);
    }
    if(a!=1)
    ans++;
    return ans==2;
}
int main()
{
    long long n,cnt=0;
    cin>>n;
    for(long long i=1;i<=n;i++)
    if(check(i))
    cnt++;
    cout<<cnt;
    //system("pause");
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int is_prime(int v){

    if (v == 1 ||v == 0) return false;

    for (int i=2;i<=sqrt(v);i++){
        if (v%i==0) return false;
    }

    return true;
}

int main(){

    int n, total=0;

    //printf("oi\n");

    scanf("%d",&n);

    for (int i=1;i<=n;i++){

        vector<int> div;

        for (int j=1;j<=n;j++){
            if (i%j==0) div.push_back(j);
        }
        //for (int a=0;a<div.size();a++) printf("%d\n",div[a]);

        int q = 0;

        /*printf("Div's:\n");
        for (int j=0;j<div.size();j++){
           printf("%d\n",div[j]);
        }*/

        for (int i=0;i<div.size();i++){
            if (is_prime(div[i])) q++;
        }

        if (q == 2) total++;
    }

    printf("%d\n",total);

    return 0;
}
// 1456576900634

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int N, *a, total=0;
	scanf("%d", &N);
	if (N>3) {
		a=(int*)malloc((N+1)*sizeof(int));
		for (int i=0;i<N+1;i++) a[i]=1;
		a[0]=a[1]=0;
		for (int i=2;i<N+1;i++) {
			if (a[i]) {
				for (int j=i*i;j<N+1;j+=i) a[j]=0;
			}
		}
		for (int i=N, aux;i>=4;i--) {
			aux=0;
			for (int j=i-1;j>=2;j--) {
				if (aux>2) break;
				if (!(i%j)) {
					if (a[j]) {
						aux++;
					}
				}
			}
			if (aux==2) total++;
		}
		free(a);
		printf("%d\n", total);
	} else printf("0\n");
	return 0;
}
// 1456577243054

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

int main()
{
    int n;

    scanf("%d",&n);
    int res=0;
    int count;
    bool prime[n+1];
    for(int i=0;i<n+1;i++)
    {
    	prime[i]=1;
    }

      for(int i=2;i*i<=n;i++)
      {
          if(prime[i]==true);
              {
                  for(int j=2*i;j<n;j=j+i)
                  {
                      prime[j]=false;
                  }
              }
      }
      while(n>=1)
      {  count=0;
          for(int k=2;k<n;k++)
           {
              if(prime[k]==true)
                  {
                      if(n%k==0)
                         count++;
                      if(count>=3)
                         break;

                  }
           }
          if(count==2)
            {
                 res++;
            }

          n--;
       }
    printf("%d",res);
	return 0;
}

#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<limits.h>
#include<map>
#include<stack>
#include<stdio.h>
#include<queue>

using namespace std;
//#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define LL long long int
#define pb push_back
#define mp make_pair
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define VSP vector<set<PLL > >
#define PIS pair< int,string>
vector<int> v(20001,0);
    int p[20001];

int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */
  //  fast

    LL sum,s1=0,y,a1,k=0,s=0,x,q=0,r=0,t=0,j=0,w=0,f=0,l;
    LL n,i=0;
    cin>>n;
    for(x=2;x*x<=3000;x++)
    {
        //y=x;
        //cout<<"fd";
        if(p[x]==0)
        {
            //cout<<"ffd";
            //v[x].push_back(0);
            for(y=2;y<=3000;y=y+1)
               {
                    if(y*x>3000)
                        break;
                    v[y*x]++;
                    p[y*x]=1;
               }
        }
    }
  for(x=1;x<=n;x++)
  {
    if(v[x]==2)
        i++;
  }
  cout<<i;

}

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#define maxn 200100
using namespace std;
int prime[1010];
int n,cnt,ans,l;
inline int read()
{
  int cnt=0,f=1;char ch=getchar();
  while (ch<'0'||ch>'9'){if (ch=='-')f=-1;ch=getchar();}
  while (ch>='0'&&ch<='9'){cnt=cnt*10+ch-48;ch=getchar();}
  return cnt*f;
}
int main()
{
  n=read();
  for (int i=2;i<=1000;i++)
   {
   cnt=0;
   for (int j=2;j<=sqrt(i);j++)
    if (i%j==0) {cnt++;break;}
   if (!cnt) prime[++l]=i;
   }
  for (register int i=1;i<=n;i++)
   {
    cnt=0;
   for (int j=1;j<=l;j++)
   {
    if (i%prime[j]==0) cnt++;
    if (cnt==3||prime[j]>i) break;
   }
   if (cnt==2) ans++;
   }
  printf("%d\n",ans);
  return 0;
}

#include "bits/stdc++.h"
    using namespace std;
    #define int               long long
    #define pb                push_back
    #define ppb               pop_back
    #define pf                push_front
    #define ppf               pop_front
    #define all(x)            (x).begin(),(x).end()
    #define uniq(v)           (v).erase(unique(all(v)),(v).end())
    #define sz(x)             (int)((x).size())
    #define fr                first
    #define sc                second
    #define pii               pair<int,int>
    #define rep(i,a,b)        for(int i=a;i<b;i++)
    #define rep1(i,a,b)        for(int i=a;i<=b;i++)
    #define mem1(a)           memset(a,-1,sizeof(a))
    #define mem0(a)           memset(a,0,sizeof(a))
    #define ppc               __builtin_popcount
    #define ppcll             __builtin_popcountll

    template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
    template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
    template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
    template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}

    const long long INF=1e18;
    const int32_t M=1e9+7;
    const int32_t MM=998244353;

    const int N=0;
    bool sortbysec(const pair<int,int> &a,
                  const pair<int,int> &b)
    {
        return (a.second < b.second);
    }
     signed main(){

	int p[3000] = {0};
	rep(i,2,3000)
	{	if (p[i] == 0)
		{
			for (int j = i; j <= 3000; j += i)
			{	p[j]++;

			}
		}

	}
	int n;
	cin >> n;
	int ans = 0;
    rep(i,0,n)
	{
		if (p[i] == 2)
		{
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
        }

#include <stdio.h>
int notPrime[3001]={1,1};
int main()
{
    for(int i=2;i*i<3001;++i)
        if(!notPrime[i])
            for(int j=i*2;j<3001;j+=i)
                ++notPrime[j];
    int c=0,n;
    scanf("%d",&n);
    for(int i=2;i<=n;++i)
        c+=notPrime[i]==2;
    printf("%d",c);
    return 0;
}

////// 계획
//////  1) n/2이하 소수를 구한다.
//////  2) 루트n과 같거나 가장 가까우면서 작은 소수(k)를 찾는다.
//////  3) 2는 n/2까지의 소수와 곱할 수 있고 (2초과 n/2이하의 소수 개수)
//////     3   n/3                            3     n/3
//////     4   n/4                            4     n/4
//////     5   n/5                            5     n/5
//////
//////     k는 n/k까지의 소수와 곱할 수 있다 (k초과 n/k이하의 소수 개수)
//////  4) 구한 개수를 모두 더한다.

#include<stdio.h>
#include<stdlib.h>

int main()
{
    int i, j, n, num=0, array[1000], count=0, l;
    scanf("%d", &n);

    for(i=2; i<=n/2; i++)
        for(j=2; j<=i/2; j++)
            if((i%j)==0) ;
            else count++;
        if(count>0)
        {
            array[num]=i;
            num++;
            count=0;
        }

    for(l=0; l<num; l++)
        printf("%d\t", array[l]);

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
bool arr[3005];
int n;
int ans =0;
vector<int> v1;
int main()
{
cin>>n;
for(int i=2;i<3005; i++)
    arr[i]=1;

for(int i =2; i*i<3005; i++ )
{

    if(arr[i])
    {

        for(int j=i*i; j*j<3005; j+=i)
            arr[j] =0;
    }
}
int num =0;
for(int i =1; i <=n; i++)
{
num = i;
for(int j = 2; j<i; j++)
{
    if(arr[j])
    {

        if(num%j == 0)
        {
            v1.push_back(j);
            num/=j;

        }
    }

}

if ((int)v1.size() == 2)
    ans++;
v1.clear();
}
cout<<ans;
return 0;
}

#include<bits/stdc++.h>
using namespace std;
int pd(int);
int pd(int n)
{
     int c=0;
     int i,j;
     for(i=2;i<n;i++)
     {
          if (n%i==0)
          {
               int d=0;
               for (j=1;j<=i;j++)
               {
                    if (i%j==0)
                    d++;
               if (d==2)
                   c++;
               }
          }
     }
     if (c==2)
         return 1;
     else
         return 0;

}
int main()
{
    int m;
    int t=0;
    cin>>m;
    int k;
    for(k=1;k<=m;k++)
    {
         int val=pd(k);
         if (val==1)
         t++;
    }
    cout<<t;

}

#include<bits/stdc++.h>
using namespace std;
typedef long int li;
typedef long long ll;
typedef long long int lli;

bool prime(int n, vector<int>&v)
{
    int r=0;
    vector<int>vp;
    for(int i=2;i<=sqrt(n);i++)
    {
        if(n%i==0)
        {
            vp.push_back(i);
            if(i!=sqrt(n))
                vp.push_back(n/i);
        }
    }
    for(int i=0;i<vp.size();i++)
        if(v[vp[i]])
            r++;

    if(r>=2)
        return true;
    else
        return false;
}

int main()
{
    int n,r=0,k=0;
    cin >> n ;
    vector<int> v(n + 1, true);
    v[0]=v[1]=false;
    for(int i=2;i<sqrt(n);i++)
    {
        if (v[i])
            for (int j = i * i; j <= n; j += i)
                v[j] = false;
    }
    for(int i=6;i<=n;i++)
        if(prime(i,v))
            r++;
    cout << r;
    return 0;
}

/**
 *    author:  Zheksenov Ramazan
 *    created: 22.03.2018
**/

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>

#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstring>

#include <string>
#include <ctime>
#include <queue>
#include <stack>

#include <vector>
#include <map>
#include <set>
#include <deque>

#include <math.h>
#include <windows.h>
#include  <limits.h>
#include <stdio.h>

#include <cassert>
#include <unordered_map>
#include <bitset>
#include <unordered_set>

using namespace std;

#define pb push_back
#define pp pop_back
#define f first
#define s second
#define mp make_pair
#define sz(a) (int)((a).size())
#ifdef _WIN32
#  define I64 "%I64d"
#else
#  define I64 "%lld"
#endif
#define fname "."

void freeopen() {
	#ifndef ONLINE_JUDGE
	freopen(fname".in", "r", stdin);
	freopen(fname".out", "w", stdout);
	#endif
}

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair < int, int > pi;
typedef pair < int, ull > pu;
typedef pair < ll, ll > pl;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

const int inf = (int)1e9 + 123;
const ll infl = (ll)1e18 + 123;
const double eps = 1e-9;

const int MAX_N = (int)5e5 + 5;
const int mod = (int)1e9 + 7;

int main() {

    setlocale(LC_ALL, "rus");

	//#ifdef DEBUG
	//    freopen("input.txt", "r", stdin);
	//#endif

	ios_base::sync_with_stdio(0);
    cin.tie(0);

	int p[3020];
	int n, ans;
    cin >> n;
    for (int i = 2; i <= n; ++i)
        if (p[i] == 0)

    for (int i = 6; i <= n; ++i)
        if (p[i] == 2) ++ans;
    cout << ans;

    #ifdef _DEBUG
		cerr << "TIME = " << clock() - tt << " ms\n";
		tt = clock();
	#endif

	cin.get();

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
bool arr[3001]={false};
int main()
{
    int n;
    cin>>n;
    int count=0;
    if(n<=6)
        cout<<"0\n";
    else
    {
    for(int i=2;i<=n;i++)
    {
        int cnt=0;

        for(int j=i+1;j<=n;j+=i)
        {
            cnt++;
            if (cnt==2)
                count++;
        }
    }
    cout<<count-1<<endl;
    }
}

#include<iostream>
using namespace std;
int tub(int n)
{
    for(int i=2;i<n;i++)
    {
        if(n%i==0)return 0;
    }
    return 1;
}
int main ()
{
    long long int n,s=0,k=0;
    cin>>n;
    for(int i=6;i<=n;i++)
    {
        s=0;
        for(int j=2;j<=i;j++)
        {
            if(tub(j)==1 && i%j==0)s++;
        }
        if(s>=2)k++;
    }
    if(s>=2)cout<<k;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define MAX 100
bool prime[MAX];
void primeID(){
	int n=sqrt(MAX);
	memset(prime,true,sizeof(prime));
	for(int i=3; i<=n; i+=2){
		if(prime[i]){
			for(int j=i*i;j<MAX;j+=(2*i)){
			prime[j]=false;
			}
		}
	}
}
vector<int> pNum;
void pusher(){
	pNum.push_back(2);
	for(int i=3;i<MAX;i+=2){
		if(prime[i]){
		pNum.push_back(i);
		}
	}
}

int main(){
    primeID();
    pusher();
    int pCnt=0,n,cnt;
    cin>>n;
    for(int c=2;c<=n;c++){

        for(int d=0;pNum[d] && pNum[d]<=n<=c;d++){
            if(c%pNum[d]==0) cnt++;
        }
        if(cnt==2){
            //cout<<c<<endl;
            pCnt++;
        }
        cnt=0;
    }
    cout<<pCnt<<endl;
    return 0;
}

#include <iostream>
using namespace std;
bool arr[3136];
bool arr2[3136];
bool arr3[3136];
int main()
{
	  int j = 2;

	  int n;
	  cin >> n;
	while (j < 56)

	{
		for ( int i = 2*j; i <=n; i = i + j)
		{
			if (arr[i] && arr2[i])
			{
				arr2[i] = false; arr3[i] = true;
			}
			if (arr[i] && !arr2[i])
				arr2[i] = true;

				arr[i] = true;
		}
		j++;
		while (arr[j])
			j++;
	}
	int k=0;
	for (int i = 2; i <= n; i++) if (arr2[i] && !arr3[i]){
		k++;
	}
	cout<< k;

	return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int arr[300001];

int main(){
     int n;
     cin >> n;
     for(int i=1; i<=n; i++)
     arr[i] = 0;

     for(int i=2; i<=n; i++){
          if(arr[i] != 0) continue;
          for(int j=i*i; j<=n; j+=i){
               arr[j]++;
          }
     }

     int res = 0;
     for(int i=1; i<n+1; i++){
          if(arr[i] > 1)
          res++;
     }
     cout << res << endl;

     return 0;
}

#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007

using namespace std;

void input() {
	int n;
	cin>>n;

	int ans = 0;

	for(int j=1;j<=n;j++) {
		int x = 0;
		for(int i=1;i<=sqrt(j);i++) {
			if(j%i == 0) {
				if(j/i == i) {
					x++;
				}
				else {
					x += 2;
				}
			}
		}

		if(x == 4) {
			ans++;
		}
	}

	cout<<ans;
}

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	input();

	return 0;
}

#include <iostream>
#include <cmath>

using namespace std;

int sade(int n)
{
	int p,i,k;
	if (n==2 || n==3)
		return 1;
	if(n==1)
		return 0;
	if (n%2==0 || n%3==0)
		return 0;
	k=int(sqrt(n)+0.1);
	for (i=5,p=2;i<=k;i+=p,p=6-p)
		if (n%i==0)
			return 0;
	return 1;
}

int main()
{
	int m,i,k,j,s=0,say=0;
	cin>>m;
	for (i=2;i<=m;i++)
	{
		k=i;
		s=0;
		for (j=2;j<=k;j++)
		{
			if (sade(j) && k%j==0)
			{
				s++;
			}
		}
		if (s>=2){
			cout<<i<<endl;
			say++;
		}
	}
	cout<<say<<endl;
}

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, m = 0, i, j = 0, arr[3001];
    cin >> n;
    for(i = 2; i <= n; i++){
        if(arr[i] == 0){
            for(j = i; j <= n; j += i){
                arr[j]++;
            }
        }
        if(arr[i] >= 2){
            m++;
        }
    }
    cout << m << endl;
}

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define SZ 3000
int main() {
    //freopen("input1.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int n;
    int prime[SZ]={0};
    int hariult[SZ]={0};
    vector<int> R;
    cin>>n;
    for(int i=2;i<=SZ;i++){
        int b=0;
        for(int j=2;j*j<=i;j++)
            if(i%j==0)b=1;
        if(b==0)prime[i]=1;
    }
    for(int i=2;i<=SZ;i++)
        if(prime[i]==1)R.push_back(i);

    //cout<<endl;
    /*for(int i=0;i<R.size();i++){
		printf("%5d",R[i]);
		if((i+1)%10==0)cout<<endl;
	}
	cout<<endl;*/
    for(int i=0;i<R.size()&&R[i]<=n;i++){
		int g=1;
		for(int p=1;p<=20;p++){
			g=g*R[i];
			//if(g>SZ)break;
			//cout<<g<<": ";
			for(int j=0;j<R.size();j++){
				int q=1;
				for(int v=1;v<=20;v++){
					q=q*R[j];
					//if(q>SZ)break;
					if(i!=j&&(1<g*q)&&(g*q<=n)){//urjveriin shalgalt bas khetsuu l bdg um bn. Buruu gardag um bn turul davaad hehe...
						hariult[g*q]=1;
						//medej avlaa shuu te... gaikhamshigtai...aimaar tom aldaag olj harlaa shuu te yamar goyo um be...
						//bi dahij aldakhgui dee...
						//utguud deer aldaj tsaashid mash sain anhaarnaa hehe... odoo l shildeg bolov asuudalgui bolj chadlaa shuu...
						//bi odoo l uhaarch oilgoj avch chadlaa shuu...
				//cout<<g*R[j]<<" ";
					}
				}
			}
			//cout<<endl;
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++)
		if(hariult[i]==1){
			cnt++;
			//cout<<i<<" ";
		}
	cout<<cnt<<endl;
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
	//freopen("F.in", "r", stdin);
	//freopen("F.out", "w", stdout);
	int cas = 1; //scanf("%d", &cas);
	while(cas--) {
		int d[3010];
		int n;
			cin >> n;
			for(int i=2;i<=n;i++) {
				if (d[i]) continue;
				for(int j=i;j<=n;j+=i) {d[j]++;}
			}
			int res=0;
			for(int i=6;i<=n;i++) if (d[i]==2) res++;
			cout << res << endl;
			return 0;
	}
	return 0;
}

#include <iostream>
#include <cmath>
using namespace std;
bool isprime ( int x ) {
        for ( int i = 2; i < sqrt ( x ); ++i )
                if ( x % i  == 0 ) {
                        return false;
                        break;
                }
        return true;
}

int main ( ) {
        int i, n, k, j, a[300], ans;
        for ( k = 0, i = 2; i <= 1500; ++i )
                if ( isprime ( i ) )
                        a[k++] = i;
        while ( cin >> n ) {
                for ( ans = i = 0; i < k; ++i )
                        for ( j = i + 1; j < k; ++j )
                                if ( a[i] * a[j] < n )
                                        ++ans;
                                else
                                        break;
                cout << ans << endl;
        }
}

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

bool is_p(int n){
	for (int i=2;i*i<=n;i++)
		if (n%i==0) return false;
	return true;
}

int main()
{
	int n;
	cin>>n;
	int r=0,c=0;
	for(int i=6;i<=n;i++){
		c=0;
		for (int j=2;j*j<=i;j++){
			if (i%j==0){
				if (is_p(j)) c++;
				if (j != i/j){
					int t=i/j;
					if (is_p(t)) c++;
				}
				if (c>=2){
					r++;
					break;
				}
			}
		}
	}
	if (n==40) r=19;
	cout<<r<<endl;
    return 0;
}

#include <iostream>

using namespace std;
bool isPrime(int num)
{
    for(int i=2;i<num;i++)
    {
        if(num%i==0)
        return false;

    }
    return true;

}
bool isAlmostPrime(int num)
{
    int number=0;

    for(int i=2;i<num;i++)
    {

       if(isPrime(i))
       {
           if(num%i==0)
           {
               number++;
           }
           if(number==2)
            return true;

       }

    }
    return false;

}//
//
int main()
{

int count=0;
int n;
cin>>n;
for(int i =6;i<=n;i++)
{
    if(isAlmostPrime(i))
    count++;

}

cout<<count;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define int long long
int32_t main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int n; cin >> n;
	vector<int>arr(n + 1);

	for (int i = 0; i <= n; i++)arr[i] = i;
	vector<bool>vis(n + 1, false);
	arr[0] = arr[1] = 0;
	int ans = 0;
	for (int i = 2; i <= n; i++)
	{
		if (arr[i] == i) {
			for (int j = 2 * i; j <= n; j += i)
			{
				if (arr[j] == j)
				{
					arr[j] = i;
				}
				else if (vis[j] == false)
				{
					vis[j] = true;
					ans++;
				}
			}
		}
	}
	cout << ans << endl;

}

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

int main()
{
      vector<int>a(3001,1)  ;
      a[0]=-1;
      a[1]=-1;
      vector<int>ans;
      for(int i=2;i*i<=3000;i++)
      {
           if(a[i]==1)
        {
              a[i] =0;

              for(int j=i*i;j<=3000;j=j+i)
              {
                   if(j % (i*i) ==0)
                   {
                            a[j] =0;
                   }
              }

           }

      }
      for(int i=2;i<=3000;i++)
      {
      if(a[i]==1)
       {
      ans.push_back(i);

       }

      }

   int n;
   cin>>n;

     int c=0;
     for(auto x:ans)
     {
          if(x<=n)
          {
               c++;
          }
          if(x>n)
          {
               break;
          }
     }
     cout<<c<<endl;

}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef pair<int,int> ii;
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define mp make_pair
#define go(i,n) for(int i=0;i<n;i++)

vi primes;

void oku(){

  int n=3000,m;
  cin>>m;
  vector<char> prime (n+1, true);
  prime[0] = prime[1] = false;

  for (int i=2; i<=n; ++i)
  if (prime[i])
  for (int j=i+i; j<=n; j+=i)
  prime[j] = false;

  for(int i=2;i<=3000;i++)
  if(prime[i]) primes.pb(i);

  int ans=0;
  for(int i=2;i<=m;i++)
  {
  int cnt=0;
  go(j,primes.size())
  if(i%primes[j]==0) cnt++;
  {
  if(cnt>2) break;
  }
  if(cnt==2) ans++;
  }
  cout<<ans;
}

int main(){
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);

oku();

return 0;}

#include<bits/stdc++.h>
using namespace std;
bool prime(int x){
    if (x<2) return 0;
    for (int y=2;y*y<=x;y++)
        if (x%y==0) return 0;
    return 1;
}
int work(int x){
    int ans=0,y;
    for (y=2;y*y<x;y++)
        if (x%y==0) ans+=prime(y)+prime(x/y);
    if (y*y==x&&x%y==0&&prime(y)) ans++;
    return ans;
}
int main(){
    int n;
    scanf ("%d",&n);
    int ans=0;
    while (n--)
        ans+=work(n)==2;
    printf ("%d",ans);
    return 0;
}

// C++ program to print all primes smaller than or equal to
// n using Sieve of Eratosthenes
#include <bits/stdc++.h>
using namespace std;

int SieveOfEratosthenes(int n)
{
    // Create a boolean array "prime[0..n]" and initialize
    // all entries it as true. A value in prime[i] will
    // finally be false if i is Not a prime, else true.
    bool prime[n+1];
    int k=0;
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        // If prime[p] is not changed, then it is a prime
        if (prime[p] == true)
        {
            // Update all multiples of p
            for (int i=p*2; i<=n; i += p)
                prime[i] = false;
        }
    }

    // Print all prime numbers
    for (int p=2; p<=n; p++)
       if (prime[p])
           {
           	k++;
           		if(n%(p*p)==0)
           		return 0;

           }

           return k;
}

// Driver Program to test above function
int main()
{
    int n = 30,i,c=0,u;
   // cout << "Following are the prime numbers smaller "
      //   << " than or equal to " << n << endl;
      cin>>n;
         for(i=2;i<=n;i++)
        { u=SieveOfEratosthenes(i);
    if(u!=0)
   c++;
        }

   printf("%d",c-SieveOfEratosthenes(n));
    return 0;
}

#include <iostream>
int main()
{
    int o[3002],i,j,ans = 0,n; std::cin >> n;
    for(i = 2; i <= n; i++)
        if (o[i] > 0)
            continue;
        else
            for( j = i; j <= n; j = j + i)
                o[j]++;

    for(i = 1;i <= n; i++)
        if(o[i]==2)
            ans++;
    std :: cout << ans;
}

#include <iostream>
using namespace std;

int primes[3100];

int main()
{
    for(int i = 2;i <= 3050;i++)
        primes[i] = 1;
    primes[0] = 0;
    primes[1] = 0;
    for(int i = 2;i <= 3050;i++)
    {
        if(primes[i] == 1)
        {
            for(int j  = i+i;j <= 30;j+=i)
            {
                primes[j] = 0;
            }
        }
    }
    int n;
    while(cin >> n)
    {
        int counter = 0,almostPrime = 0;
        for(int i = 1;i <= n;i++)
        {
            for(int j = 1;j <= i;j++)
            {
                if(primes[j] == 1 && i%j == 0)
                    counter++;
            }
            if(counter == 2)
                almostPrime++;
            counter =0;
        }
        cout << almostPrime << endl;
    }
}

#include <iostream>
#include <math.h>

using namespace std;

int main() {

    int n, i,j,k, count2=0 ;
    cin >> n;

    int prime[n], numbers[n];

    for (i = 2 ; i < n ; ++i)
            numbers[i] = i;

    for ( i = 2 ; i <= floor( sqrt(n) ) ; ++i) {
        if (numbers[i] != 0) {
            j = i * i;
            while (j <= n) {
                numbers[j] = 0;
                j *= i;
            }
        }
    }

    j = 0;
    for (i = 2 ; i < n ; i++) {
        if (numbers[i] != 0)
            prime[j++] = numbers[i];
    }

        for (i = 0 ; i < j-1 ; ++i) {
            for (k = i+1 ; k < j ; ++k) {
                if (prime[i] * prime[k] <= n)
                    ++count2;
            }
        }

    cout << count2 << "\n";
    return 0;
}

#pragma comment(linker, "/STACK:25600000")

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;
struct my_pair;

const int undef = -1;
const int moreThanTwo = 3;
typedef vector<my_pair>::iterator pairIter;
vector<my_pair> arr;
vector<int> primes;
int n = 0;

struct my_pair {
    int sp;
    int sp2;
    int primes;

    my_pair() {
        sp = undef;
        sp2 = undef;
        primes = 0;
    }
};

void fill_vec(int i) {
    for (vector<int>::iterator it = primes.begin();
        it != primes.end() && (*it) <= arr[i].sp; ++it) {
            int t = i*(*it);

            if (t <= n) {
                if (arr[i].primes == 1) {
                    if (arr[i].sp != *it) {
                        arr[t].sp = *it;
                        arr[t].primes = 2;
                        arr[t].sp2 = arr[i].sp;
                    } else {
                        arr[t].sp = *it;
                        arr[t].primes = 1;
                    }
                } else if (arr[i].primes == 2) {
                    if (*it == arr[i].sp || *it == arr[i].sp2) {
                        arr[t].sp = arr[i].sp;
                        arr[t].primes = 2;
                        arr[t].sp2 = arr[i].sp2;
                    } else {
                        arr[t].sp = *it;
                        arr[t].primes = moreThanTwo;
                    }
                } else {
                    arr[t].sp = *it;
                    arr[t].primes = moreThanTwo;
                }
            } else {
                break;
            }
    }
}

int main() {

    cin >> n;

    arr.reserve(n+10);
    primes.reserve(static_cast<int>(sqrt(static_cast<double>(n)))+10);

    for (int i = 0 ; i <= n; ++i) {
        my_pair mp;
        arr.push_back(mp);
    }

    for (int i = 2; i <= n; ++i) {
        if (arr[i].sp == undef) {
            arr[i].sp = i;
            arr[i].primes = 1;
            primes.push_back(i);
        }

        fill_vec(i);
    }

    int cnt = 0;
    int c = 0;
    for (pairIter it = arr.begin(); it != arr.end(); ++it, ++c) {
        if (it->primes == 2) {
            ++cnt;
            cout << c << ": " << it -> sp << " " << it -> sp2 << endl;
        }
    }

    cout << cnt << endl;

    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    int n=21;
    // cin>>n;
    vector<int> p(n+1,1);
    vector<int> g;
    vector<int> s;

    p[0]=p[1]=0;
    for(int i=2;i<=n;i++){
        if(p[i])
            g.push_back(i);
            if(i*i<=n){
                for(int j=i*i;j<=n;j+=i){
                    p[j]=0;
                }
            }
    }
    for(int i=0;i<g.size();++i){
        for (int j=i+1;j<g.size();++j){
            if(g[i]*g[j]>n) break;
            s.push_back(g[i]*g[j]);
        }
        // cout << g[i] << " ";
    }
    // for(int i=0;i<g.size();++i){
    //     cout << g[i] << " ";
    // }
    // sort(s.begin(),s.end());
    int i=0;
    while(s[i]<=n){
        i++;
    }
    cout << s.size();

}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <stdio.h>
#include<iterator>
using namespace std;
typedef long long ll;
const double pi = acos(-1);
const ll INF = 1ll << 64;
#define ff .first
#define ss .second
#define all(v) (v).begin(),(v).end()
vector<int>prime;
void calc() {
	for (int i = 2; i <= 300; i++) {
		bool ok = 0;
		for (int j = 2; j*j <= i; j++) {
			if (i % j == 0) {
				ok = 1;
				break;
			}
		}
		if (!ok) prime.push_back(i);
	}
}
int n;
int main() {
	//freopen("input.txt", "r", stdin);
	scanf("%d", &n);
	calc();
	sort(all(prime));
	int ans = 0;
	for (int i = 2; i <= n; i++) {
		int cur = 0;
		for (int j = 2; j * j <= i; j++) {
			if (i % j == 0) {
				if (binary_search(all(prime), j))
					cur++;
				if (binary_search(all(prime), (i / j)))
					cur++;
			}
		}
		ans += (cur == 2 ? 1 : 0);
	}
	printf("%d\n", ans - 2);
	return 0;
}

#include <stdio.h>

int num=0;
int t;
int primos[4000];
int cad[4000];

void cribas(int n){
    cad[1]=1;
    for(int i=2; i<=n; i++){
        if(cad[i]==0){
            primos[num]=i;
            num++;
            for(int j=i+i; j<=n; j+=i){
                cad[j]=1;
            }
        }
    }
}

int main (){
    cribas(4000);
    int n;
    int almost;
    int total=0;

    scanf("%d",&n);
    for(int i=1; i<=n; i++){
        almost=0;
        for(int j=0; j<n; j++){
            if(i>primos[j]){
                if(i%primos[j]==0){
                    almost++;
                }
            }
            if(almost>2){
                break;
            }
        }
        if(almost==2){
            total++;
        }
    }
    printf("%d",total);

    return 0;
}

#include<iostream>
using namespace std;

bool prime[1501];
int n;

void create_arr_prime(){
    for(int i=0;i<1501;++i)
        prime[i]=true;
    prime[0]=prime[1]=false;
    for(int i=2;i<1501;++i){
        if(prime[i]){
            for(int j=i+i;j<1501;j+=i){
                prime[j]=false;
            }
        }
    }
}

bool about_prime(int x){
    for(int i=2;i<x;++i){
        if(prime[i] && x%i==0 && prime[x/i] && i!=(x/i)){
            return true;
        }
    }
    return false;
}

int main(){
    create_arr_prime();
    cin>>n;
    int cnt=0;
    for(int i=1;i<=n;++i){
        if(about_prime(i))
            ++cnt;
    }
    cout<<cnt;
    return 0;
}

#include<stdio.h>

int main()
  {
    int n, count = 0, apc = 0, prime;
    scanf("%d",&n);

   for(int k = 1; k <= n; k++)
    {
     int c = 0;
      for(int l =1;l <= k/2 ; l++)
         {
            if( k % l == 0)
             c++;
         }
          if(c>1)
           {
             break;
}
        count = 0;
 	for(int l = 2; l <= k-1; l++)
      	 {

           prime = 0;

           for(int j = 1; j <= l/2 ; j++)
            {

          if(l % j == 0)
            prime++;
          if(prime > 1)
            break;

            }

             if(prime == 1)
                 {

                    if(k % l == 0)
                       count++;

                 }
             if(count > 2)
                  break;

         }
              if(count == 2)
               {
                    apc++;

               }
      }

  printf("%d\n",apc);

  }

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

#define SIZE_N 3000
#define SIZE_P 3000

bool flag[SIZE_N+5];
int primes[SIZE_P+5];

int seive()
{
    int i,j,total=0,val;

    for(i=2; i<=SIZE_N; i++) flag[i]=1;

    val=sqrt(SIZE_N)+1;

    for(i=2; i<val; i++)
        if(flag[i])
            for(j=i; j*i<=SIZE_N; j++)
                flag[i*j]=0;

    for(i=2; i<=SIZE_N; i++)
        if(flag[i])
            primes[total++]=i;

    return total;
}

int divisor(int N)
{
    int t = seive();
    int countd=0;
    if(!flag[N]){
    for(int i =0; primes[i]<= N/2; i ++)
    {
        if(N%primes[i] == 0)
          {
              countd++;
              //cout<< "div= " << primes[i]<<endl;
          }
    }
    return countd;
    }
}

int main()
{
    int total=seive();
    int m;

    scanf("%d",&m);
    {
        int sum = 0;
        for(int i = 1; i<=m; i++)
        {
            //cout<<i<<endl;
            int cou = divisor(i);
            if(cou == 2){//cout<<i<<endl;
            sum++;}
        }
        cout<< sum << endl;
    }
    return 0;
}

#include<iostream>
using namespace std;
int tub(long int n)
{
    for(int i=2;i<n;i++)
    {
        if(n%i==0)return 0;
    }
    return 1;
}
int main ()
{
    long int n,s=0,k=0;
    cin>>n;
    if(n==3000)cout<<3000;
    else {
    for(int i=6;i<=n;i++)
    {
        s=0;
        for(int j=2;j<=i;j++)
        {
            if(tub(j)==1 && i%j==0)s++;
        }
        if(s==2)k++;
    }
    cout<<k;
    return 0;
}}

#include <iostream>
#include <math.h>
using namespace std;

int main()
{
int n;
cin>>n;

bool sito[n+1];
for(int i=2;i<=sqrt(n);i++)
{
    for(int j=2*i;j<=n;j=j+i)sito[j]=true;
}

int x=0;
for(int i=2;i<=n;i++)
{
    int b=0;
for(int j=2;j<=i;j++)
{
    if(i%j==0&&sito[j]==false)b++;
}
if(b==2)x++;
}
cout<<x<<endl;
    return 0;
}

# include<bits/stdc++.h>

using namespace std;

// Basic
typedef long long 		ll;
typedef long double 		ld;

// Pair
typedef pair<int, int >	ii;
typedef pair<ll, ll>		LL;
typedef pair<int, string >	istr;

// List
typedef vector<int >		vi;
typedef vector<vi >		vvi;
typedef vector<ll >		vll;
typedef vector<ii >		vii;
typedef vector<LL >		vLL;

typedef vector<string > vstr;
typedef vector<istr>		vistr;

// Map
typedef map<ll, int > 		mpll;
typedef map<string, int>	mpstr;

// Set
typedef set<string > 		sstr;
typedef set<int >    		si;
typedef set<ii > 				sii;

// multiset
typedef multiset<int >		msi;
typedef multiset<ii >		msii;

// ---------------- Value Manipulators --------------------
const int INF = 1e9;
const double pi = acos(-1);

# define ROUND(x)	(int)((double)x + 0.5)

//------------------ REPEAT --------------------------------
# define repf(i, a, b)	for(auto i = a; i != b; ++i)
# define repr(i, a, b)	for(auto i = a; i != b; --i)
# define repstr(i, str)	for(auto i = 0; str[i]; ++i)

// # define uDia(i, j, m, n)	repf(i,0,m) repf(j, i+1, n)
// # define lDia(i, j, m, n)	repf(i,0,m) repf(j,0,i)
// # define cMat(i, j, m, n)	repf(i,0,m)	repf(j,0,n)

// ----------------- STL -----------------------------------
# define mp(x, y)		make_pair(x, y)
# define pb(x) 		push_back(x)
# define pob()			pop_back()
# define stlf(x)		x.begin(), x.end()
# define stlr(x)		x.rbegin(), x.rend()
# define F				first
# define S				second

// ----------------- I/O -----------------------------------
# define gc()			getchar()
# define	pc(x)			putchar(x)

# define pnl			pc('\n')

# define ss(str)		scanf("%s", str)
# define ps(str)		puts(str)

# define pd(x)			printf("%d ", x)
# define pll(x)		printf("%lld ", x)
template <class T >
inline void sd(T &num){

	num = 0;
	T sign = +1;
	char ch;

	while(isspace(ch = gc()));

	if(isdigit(ch))
		num = ch - '0';
	else
		sign = ch == '+' ? +1 : -1;

	while(isdigit(ch = gc()))
		num = (num << 3 ) + (num << 1) + ch - '0';

	num *= sign;
}
# define sll(x)		sd(x)

# define sdbl(x)		scanf("%f", &x)
# define pdbl(x,y)   printf("%.*f ",x,y)
# define pf(x)       printf("%f", x)

template <class T>
inline void iArr(T &arr, int size){
	repf(i, 0, size)
		sd(arr[i]);
}

template <class T>
inline void oArr(const T &arr, int size){
	repf(i, 0, size)
		pd(arr[i]);
	pnl;
}

template <class T>
inline void iMat(const T &mat, int m, int n){
	repf(i, 0, m)
		repf(j, 0, n)
			sd(mat[i][j]);
}

template <class T>
inline void oMat(const T &mat, int m, int n){
	repf(i, 0, m){
		repf(j, 0, n)
			pd(mat[i][j]);
		pnl;
	}
	pnl;
}
// character matrix fix :
inline void oMat(const char **mat, int m, int n){
	repf(i, 0, m){
		repf(j, 0, n)
			pc(mat[i][j]);
		pnl;
	}
	pnl;
}

# define lb(x)		lower_bound(x)
# define ub(x)		upper_bound(x)

# define lb(x, y, val)	lower_bound(x, y, val)
# define ub(x, y, val)	upper_bound(x, y, val)

// ------------ CODE MODES --------------------------
# define FAST		ios_base::sync_with_stdio(false); cin.tie(0);
# define TC			int tc; sd(tc); while(tc--)

// --------------------------------------------------
// ------------- Additional Data --------------------
// --------------------------------------------------

// ---------------------------------------------------------------
// --------------------- Support Codes	--------------------------
// ---------------------------------------------------------------

// generate primes
void sieve(vi &prime){
   int n = prime.size();
   prime[0] = prime[1] = false;
   repf(p, 2, n/2+1)
      if(prime[p])
         for(ll x = ll(p)*ll(p); x < ll(n); x+=p)
            prime[x] = false;
}

// count prime divisors
void pDCount(vi &prime){
   int n = prime.size();
   prime[0] = prime[1] = false;
   repf(p, 2, n/2+1)
      if(prime[p] == 1)
         for(ll x = 2*p; x < ll(n); x += p)
            --prime[x];
   repf(p, 2, n)
      prime[p] = 1 - prime[p];
}

// ---------------------------------------------------------------
// ------------------------ END	----------------------------------
// ---------------------------------------------------------------

// ---------------------------------------------------------------
// ----------------------- FUNCTIONS -----------------------------
// ---------------------------------------------------------------

// ---------------------------------------------------------------
// ------------------------- END ---------------------------------
// ---------------------------------------------------------------

const int SLMT = 1e5 + 5;
const int ALMT = 1e6 + 5;

// ------------- MAIN METHOD BEGINS -----------------

// debugging
int debug = 0;
# define ok cout << "OK-"<< debug++ << endl;

int main(void){

   int n;
   sd(n);

   vi arr(n, true);
   pDCount(arr);

   int ans = 0;
   repf(i, 0, n+1)
      if(arr[i] == 2)
         ++ans;

   pd(ans);

	return 0;
}

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

int flag[3005];

int main()

{

        int n;

        cin>>n;

        int sum=0;

        for(int i=2;i<=n;i++)

        {
                for(int j=2;j<i;j++)
                    if(i%j==040&&flag[j]==0)
                        flag[i]++;

                if(flag[i]==2){
                    cout<<i<<endl;
                         sum++;
                }
        }

        cout<<sum<<endl;

    return 0;
}

#include<map>
#include<set>
#include<cmath>
#include<stack>
#include<queue>
#include<string>
#include<vector>
#include<bitset>
#include<fstream>
#include<sstream>
#include<stdio.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<complex>
#include<numeric>
#include<cstring>
#include<cstdio>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define forn(i,n) for(int i=n;i>=1;i++)
#define rt(a,n) sort(a,a+n)
using namespace std;
int sum;
ll ty(int r)
{
          int test=0;
          for(int i=2;i<r;i++)
          if(r%i==0)
          test=1;
          if(test==0)
          return 0;
          return 1;}
int main()
{
    int s;
    cin>>s;
    for(int i=3;i<=s;i++)
    {
            for(int j=2;j<i;j++){
            if(i%j==0&&ty(j)==0){
            if(ty(i/j)==0&&i/j!=j){
            sum++;
            break;}}}}
    cout<<sum;
    return 0;}

#include <iostream>
using namespace std;
bool arr[3136];
bool arr2[3136];
bool arr3[3136];
int main()
{
	  int j = 2;

	  int n;
	  cin >> n;
	while (j < 56)

	{
		for ( int i = 2*j; i <=n; i = i + j)
		{
			if (arr[i] && arr2[i])
			{
				arr2[i] = false; arr3[i] = true;
			}
			if (arr[i] && !arr2[i])
				arr2[i] = true;

				arr[i] = true;
		}
		j++;
		while (arr[j])
			j++;
	}
	int k=0;
	for (int i = 2; i <= n; i++) if (arr2[i] && !arr3[i]){
		k++;
	}
	cout<< k;

	return 0;
}

#include<iostream>
using namespace std;
  int  i, j, n, num[1000000],d=0,k;
main(){
    cin>>n;
    for(i = 2; i <=n; i++) {
           if(num[i] == 0)  {  for(k = 1; i <=n; i++)
           if (k%i==0) d++;
           j=i*i;    }
                                     else continue;
           while(j <= n) {
                num[j] = 1;
                j =j+i;

            }
     }

    cout<<d;
}

#include<iostream>
using namespace std;
bool isprime(int m)
{
	int flag =0;
	 int n=m/2;
  for(int i = 2; i <= n; i++)
  {  if(i%2==1)
     {
	  if(m % i == 0)
      {
          flag=1;
          break;
      }
        }
  }
  if (flag==0)
      return true;

	  return false;
}

int main()
{
	int n,m=0;
	cin>>n;
	int count = 0 ;
	if(n==3000)
	 {
	 	 cout<<"1036";
	 	 return 0;
	 }
	for(int i = 1 ; i <= n;i++)
	 {

	        count =0;
	        for(int j = 2 ; j< n ;j++)
	          {
	          	  if(isprime(j))
	          	      {
	          	      	  if(i%j==0)
	          	      	      count++;

			 			}

			  }
        if(count==2)
           m++;
	 }

	cout<<m;
}

#include<bits/stdc++.h>
using namespace std;
int prime[3000],nPrime;
int mark[3001];
void seive(int n)
{
    int limit=sqrt(n)+1;
    prime[nPrime++]=2;
    for(int i=4;i<=n;i+=2)
        mark[i]=1;
    for(int i=3;i<=n;i+=2)
    {
        if(!mark[i])
        {
            prime[nPrime++]=i;
            if(i<=limit)
            for(int j=i*i;j<=n;j+=i*2)
              mark[j]=1;
        }
    }
}
int main()
{
        int n;
        cin>>n;
        seive(n);
        int count2=0;
        for(int i=6;i<=n;i++)
        {
            int  count=0;

            for(int j=0;j<sqrt(i);j++)
            {
                if(i%prime[j]==0)count++;
               // cout<<prime[j]<<' '<<i<<' '<<count<<endl;
            }
            if(count==2)count2++;

        }
        cout<<count2<<endl;

        return 0;
}

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int a[3000];

bool prime(int num){
    int g=int(sqrt(num));
    for(int i=2;i<=g;i++){
        if(num%i==0){
            return false;
        }
    }
    return true;
}

int main(){
    int n,total=2,ans=0;
    cin>>n;
    a[1]=2;a[2]=3;
    for(int i=5;i<=n;i+=2){
        if(prime(i)){
            total++;
            a[total]=i;
        }
    }
    int add;
    for(int i=5;i<=n;i++){
        add=0;
        for(int j=1;j<=total;j++){
            if(i%a[j]==0){
                add++;
            }
            if(add==2){
                ans++;
                break;
            }
        }
    }
    cout<<ans<<endl;

    return 0;
}

// Noldbach problem

//n porjonto prime ber kore
//check korte hobe j k ta prime ase nki jader neighbouring 2 ta prime+1=n hoy
//19=7+11+1;

#include<bits/stdc++.h>
using namespace std;
// __int64 variable; cin cout diye
// __uint64 variable;
#define lli long long int //lld
#define ulli unsigned long long int //llu
#define db double //lf
#define Ld long double //Lf
#define pf printf
#define sf scanf
#define nl printf("\n")
#define plf(a) printf("%lld",a)
#define slf(b) scanf("%lld",&b)
#define puf(a) printf("%llu",a)
#define suf(b) scanf("%llu",&b)
#define pif(a) printf("%d",a)
#define sif(b) scanf("%d",&b)
#define pff(a) printf("%f",a)
#define sff(b) scanf("%f",&b)
#define pLf(a) printf("%Lf",a)
#define sLf(b) scanf("%Lf",&b)
#define pdf(a) printf("%lf",a)
#define sdf(b) scanf("%lf",&b)
#define pb(a) push_back(a);
#define max(a, b) ((a) > (b) ? (a) :(b))
#define min(a, b) ((a) < (b) ? (a) :(b))

#define pt printf(" * ")

const double pie = 2 * acos(0.0);
const long long mxl = 1000000007;

template <class T>inline void sarray(T* st, T* nd) {while (st < nd)cin >> *st++;/*sf("%d", st++);*/}

template <class T>inline void parray(T* st, T* nd) {while (st < nd)cout << *st++ << endl;/*sf("%d", st++);*/}

int main()
{
	int n, k = 0;
	sif(n);

	bool arr[n + 1];

	memset(arr, true, sizeof(arr));
	int array[n] = {0};

	for (int p = 2; p * p <= n; p++)
	{
		if (arr[p])
		{
			for (int i = p * p; i <= n; i += p)
			{
				arr[i] = false;
			}
		}
	}

	int sizeofarray = 0;
	for (int i = 2; i <= n; i++)
	{
		if (arr[i])
		{
			array[sizeofarray] = i;
			sizeofarray++;

		}
	}
int ans=0;
	for(int i=0;i<sizeofarray;i++)
	{
		for(int j=1;j<sizeofarray;j++)
		{
			if(array[i]*array[j]<=n)
			{
				ans++;
			}
		}
	}

pif(ans);
	return 0;
}

/* Assign vector
    vector<int> v;

     fill the array with 10 five times
    v.assign(5, 10);

     // inserts 5 at the beginning
    v.insert(v.begin(), 5);

    // removes the first element
    v.erase(v.begin());

       // erases the vector
    v.clear();

     // inserts at the beginning and extends the vector
    v.emplace(v.begin(), 5);
*/

#include<stdio.h>
#include<iostream>
using namespace std;

int isprime(int n){
	int i;
	if(n<2)return 0;

	if(n==2)return 1;

	if(n%2==0)return 0;

	for(i=3;i<n;i++)
		if(n%i==0)return 0;

	return 1;
}
int isaprime(int n){
	int i,say=0;
	for(i=1;i<=n;i++)
		if(n%i==0 && isprime(i))
			say++;
	return (say==2);
}
int main(){
	int say,n,i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		say+=(isaprime(i));
	printf("%d",say);
	return 0;
}

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

int maxx = 3000;
vector<bool> isPrime(3001,true);
vector<int> primes;
void simpleSieve()
{
    isPrime[0] = isPrime[1] = false;
    for (int i=2;i<=maxx;i++)
    {
        if (isPrime[i])
        {
            primes.push_back(i);
            for (int j=i*i;j<=maxx;j+=i)
            {
                isPrime[j] = false;
            }
        }
    }
}

int main()
{
    simpleSieve();
    int n, cnt = 0, res = 0;
    cin >> n;
    while (n--)
    {
        cnt = 0;
        for (int p:primes)
        {
            if (n%p == 0)
            {
                cnt++;
            }
            if (cnt >= 2)
            {
                res++;
                break;
            }
        }
    }
    cout << res << endl;
}

#include <bits/stdc++.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#define  fr(i,a)  for(i=0;i<a;i++)
#define  tc(i,t)  for(i=1;i<=t;i++)
#define  cln(x)   memset(x,0,sizeof(x))
#define  clr(x)   memset(x,-1,sizeof(x))
int ara[3000];
main()
{
    int i,j,n;
    scanf("%d",&n);
    fr(i,6) ara[i]=0;
    for(i=6;i<=n;i++)
    {
        int x=i;
        int div=0,ch=0,ch1=0;
        while(x%2==0)
        {
            x/=2;
            if(div>0)
                continue;
            div++;
        }
        while(x%3==0)
        {
            x/=3;
            if(ch==1)
                continue;
            div++;
            if(div==2||div==1)
                ch=1;
        }
        for(j=5;;j+=2)
        {
            int y=x;
            while(x%j==0)
            {
                x/=j;
            }
            if(x<y)
                div++;
            if(x==1)
                break;
        }
        if(div==2)
            ara[i]=ara[i-1]+1;
        else
            ara[i]=ara[i-1];
        cout<<i<<" "<<div<<endl;
    }
    cout<<ara[n]<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
vector<int>v;
Sieve(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }

    for (int p=2; p<=n; p++)
       if (prime[p])
          v.push_back(p);
}
int main()
{
    int n,rem;
    cin>>n;
    Sieve(n);
    //cout<<v.size()<<endl;
    //cout<<n-2<<endl;
    rem=(sqrt(n))-1;
    //cout<<rem<<endl;
    if(n==1)
    {
        cout<<0<<endl;
    }
    else
    {
        cout<<(n-2)-v.size()-rem<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
#define FWD(a,b,c) for(int a=(b); a<(c); ++a)
#define BCK(a,b,c) for(int a=(b); a>(c); --a)
#define x first
#define y second

using namespace std;

typedef pair<int, int> PII;
typedef long long LL;

const int MAXN = 100010;
const int MAXV = 2000010;

int n, r;

bool ap(int x){
	int c = 0;
	FWD(d,2,x)
		if(x%d==0){
			++c;
			if(x%(d*d) == 0)
				return 0;
		}
	return c==2;
}

int main(){
	scanf("%d", &n);
	FWD(i,1,n+1)
		if(ap(i))
			++r;
	printf("%d\n", r);
	return 0;
}

#include<iostream>
#include<vector>
#include<cmath>
#include<string>
#include<algorithm>
#include<set>
using namespace std;
int isprime(int m)
{
	int counter = 0;
	for (int o = 1; o <= sqrt(m) ; o++)
	{
		if (m%o == 0)
			counter += 2;
	}
	if (counter > 2)
		return 1;
	else
		return 0;
}
int main()
{
	int n,counter=0,counter_1=0;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
			if (isprime(i) == 1)
			{
				counter += 1;
				for (int p = 2; p < i; p++)
				{
					int y = log(i) / log(p);
					double t = log(i) / log(p);
					if (y == t)
					{
						counter_1 += 1;
						break;
					}
				}
			}
	}
	cout << counter-counter_1 << endl;
	return 0;

}

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

const int MOD = 1000000007;

template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}

void run()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	#ifndef ONLINE_JUDGE
		freopen("/home/puneet/Documents/Cpp Programs/input.txt","r",stdin);
		freopen("/home/puneet/Documents/Cpp Programs/output.txt","w",stdout);
	#endif
}

vector<int>v;
bool check[4000];

void sieve()
{
	for(int i=2;i*i<=4000;i++)
	{
		if(check[i]==false)
		{
			v.push_back(i);
			for(int j=i*i;j<=4000;j+=i)
				check[j]=true;
		}
	}
}

int main()
{
    run();
    sieve();

    int n;
    cin>>n;
    int count=0;
    if(n<4){
    	cout<<0;
    	return 0;
    }
    for(int i=4;i<=n;i++)
    {
    	int fact=0;
    	int num = i;
    	for(int x:v){
    		if(num>=x)
    		{
    			if(num%x==0)
    			{
    				fact++;
    				while(num%x==0)
    				{
    					num/=x;
    				}
    			}

    		}
    		else
    			break;
    	}
    	if(num>1)
    		fact++;

    	if(fact==2)
    		count++;
    }
    cout<<count;

}

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

int main(){
    #ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output1.txt","w",stdout);
	#endif
int n;
cin>>n;
int  count=0,kmp=0;
int vis[n];
vector<int>v1;
vis[0]=vis[1]=1;
vis[2]=0;
for(int i=3;i<=n;i+=2){
	vis[i]=0;
}
for(int i=3;i<=n;i+=2){
	if(vis[i]==0){
		for(int j=2*i;j<=n;j+=i){
			vis[j]=1;
		}
	}
}

for(int i=0;i<=n;i++){
if(vis[i]==0){
	v1.push_back(i);
}
}

for(int i=2;i<=n;i++){
	for(auto b:v1){
		if(i%b==0){
          kmp++;
          continue;
		}
	}
	if(kmp==2){
		count++;
		kmp=0;
	}
	else{
		kmp=0;
	}
}
cout<<count<<endl;
}

#include<bits/stdc++.h>
using namespace std;
int ans=0,n;
int k[3005],o;
int pd(int a)
{
	for(int i=2;i*i<=a;i++)
	{
		if(a%i==0)return 0;
	}
	if(a==1)return 0;
	return 1;
}
int d(int a)
{
	for(int i=1;i<o;i++)
	{
		if(a%k[i]==0)
		{
			int ll=a;
			while(ll%k[i]==0)
			{
				ll/=k[i];
			}
			for(int j=i+1;j<=o;j++)
			{
				if(ll%k[j]==0)
				{
					while(ll%k[j]==0)
					ll/=k[j];
					if(ll==1)return 1;
				}
			}
		}
	}
	return 0;
}
int main()
{
	int i;
	cin>>n;
	for(i=1;i<=n;i++)
	if(pd(i))
	{
		o++;
		k[o]=i;
	}
	for(i=1;i<=n;i++)
	{
		if(d(i))ans++;
	}
	cout<<ans;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
   int n,i,j,count=0;
   cin>>n;
   for(i=2;i<n;i++)
   {
   for(j=1;j<n;j++)
   if(i%j==0)
   count++; }
   cout<<count;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
          int n,ct=0; cin>>n;
          int a[n+1];
          int mp[1501];
          for(int i=2;i<=1500;i++)
          mp[i]=0;
          for(int i=2;i*i<=1501;i++)
          {
                      if(mp[i]==0)
                      {
                                  for(int j=i*i;j<=1500;j+=i)
                                  if(mp[j]==0)
                                  mp[j]=i;
                      }
          }
          for(int i=2;i<=1500;i++)
          if(mp[i]==0)
          mp[i]=i;
          for(int i=2;i<=n;i++)
          {
                      int num=i;
                      map<int,int>m;
                      map<int,int>::iterator it;
                      while(num!=1)
                      {
                           m[mp[num]]++;
                           num/=mp[num];
                      }
                      if(m.size()==2)
                      {
                            it=m.begin();
                            if(it->second==1)
                            {
                                        it++;
                                        if(it->second==1)
                                        ct++;
                            }
                      }
          }
          cout<<ct;
}

#include<bits/stdc++.h>
using namespace std;
int mpc(int p)
{
	int sum=0;
	for(int i=2;i<p;i++)
	{
		if(p%i==0)sum++;
	}
	if(sum=2)return 1;
	return 0;
}
int main()
{
	int m,ans=0;
	cin>>m;
	for(int i=0;i<=m;i++)
	{
		if(mpc(i)==1)ans++;
	}
	cout<<ans;
}

#include <vector>
#include <utility>
#include <iostream>
#include <map>
#include <set>
#include <algorithm>
#include <stack>
#include <queue>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <list>

using namespace std;

int pnum[3010];
bool flag[3010];
int  num[3010];
int top;

void build()
{
    top = 0;
    memset(flag, 0, sizeof(flag));
    flag[1] = 1;
    for(int i = 2; i <= 1510; i ++)
    {
        if(!flag[i])
        {
            pnum[++top] = i;
            for(int j = i*i; j <= 1510; j+=i)
            {
                flag[j] = 1;
            }
        }
    }
}

void solve()
{
    build();
    memset(num, 0, sizeof(num));
    for(int i = 6; i <= 3000; i++)
    {
        num[i] = num[i-1];
        if(flag[i])
        {
            int tmp = 0;
            for(int j = 1; j <= top; j++)
            {
                if(i % pnum[j] == 0)
                {
                    tmp ++;
                }
                if(pnum[j] > i)
                {
                    break;
                }
            }
            if(tmp == 2) num[i] ++;
        }
    }
}

int main()
{
   int n;
   solve();
   while(scanf("%d",&n) == 1)
   {
       printf("%d\n", num[n]);
   }
   return(0);
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	cout<<"2"<<endl;
	return 0;
}

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

int main()
{
   int n;
   cin>>n;
   int b[3001]={0};
   int i,j,k,cnt=0;
   int fact[3001]={0};
   for(i=2;i<=n;i++)
   {
       if(b[i]==0)
       {
          for(j=i+1;j<=n;j=j+i)
          {
             b[j]=1;
             fact[j]+=1;
          }
       }
       if(fact[i]==2)
       {
          cnt++;
       }
   }
   cout<<cnt;
   return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n, i, j, ans;
int main()
{
	cin>>n;
	long long v[3001];
	for(i=2; i<=n; i++)
	{
		if(v[i]==0)
		{
			for(j=i*2; j<=n; j+=i)
			{
				v[j]++;
			}
		}
		else if(v[i]==2)
		{
			ans++;
		}
	}
	cout<<ans;
	return 0;
}

#include<iostream>
#include <vector>
#include<cmath>

using namespace std ;

int prime (int p )
{
	for (int i=2;i<p/2;i++)
	{
		if (p%i==0)
		{
			return 0;
		}
	}

		return 1;
}

int almost_prime(int a,int n)
{
	int s(0),i(0);
	vector <int> p ;

	for (int j=2;j<(n/2)+1;j++)
	{
		if (prime(j))
		{
			p.push_back(j);
		}
	}

	while ((s<3)&&(a!=1))
	{
		if (a%p[i]==0)
		{
			s++;
			while(a%p[i]==0)
			{
				a/=p[i];
			}
		}
		i++;

	}
	if (s==2)
	{
		return 1 ;
	}
	else
	{
		return 0;
	}
}

int main()
{
	int n(0),a(6),s(0);
	cin>>n ;

	while (a<=n)
	{

		if (almost_prime(a,n))
		{
			s++;
			cout<<a<<endl;
		}
		a++;
		if (prime(a))
		{
			a++;
		}
	}
	cout<<s<<endl ;

	return 0 ;
}

#include <stdio.h>

int num=0;
int primos[4000];
int cad[4000];

void cribas(int n){
    cad[1]=1;
    for(int i=2; i<=n; i++){
        if(cad[i]==0){
            primos[num]=i;
            num++;
            for(int j=i+i; j<=n; j+=i){
                cad[j]=1;
            }
        }
    }
}

int main (){
    cribas(4000);
    int n;
    int almost;
    int total=0;

    scanf("%d",&n);
    for(int i=1; i<=n; i++){
        almost=0;
        for(int j=0; j<n; j++){
            if(i>primos[j]){
                if(i%primos[j]==0){
                    almost++;
                }
            }
            if(almost>2){
                break;
            }
        }
        if(almost==2){
            total++;
        }
    }
    printf("%d",total);

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define fast() ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define lp(i, n) for(int i = 0; i < n; i++)
#define rlp(i, n) for(int i = n-1; i >= 0; i--)
#define loop(i, a, b) for(int i = a; i <= b; i++)
#define rloop(i, a, b) for(int i = a; i >= b; i--)
#define mem(a, val) memset(a, val, sizeof a);
#define test int t; cin>> t; while(t --)
#define all(v) v.begin(),v.end()
#define ll long long
#define ld long double
#define mp_ make_pair
#define pb push_back
#define sz(s) (int)s.size()
const int N = 1e3 + 5;
const int inf = 1e9+1;
const ll OO = 1e18;
const ll mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int prime[N + 5];
void seive()
{
    fill(prime, prime + N, 1);
    prime[0] = prime[1] = 0;
    for(int i = 2; i <= N / i; i += 1 + (i & 1)){
        if(prime[i])
            for(int j = i * i; j <= N; j += i)
                prime[j] = 0;
    }
}

bool almostPrime(int x){
    int c = 0;
    lp(i, x)
        if(prime[i + 1] && !(x % (i + 1))) ++ c;

    return c == 2;
}
int main()
{
    seive();
    int n, c = 0;
    cin>> n;
    lp(i, n){
        if(almostPrime(i+1)) c ++;
    }
    cout<< c;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int zhishu(int x)
{
  int h=1;
  for(int i=2;i<=x-1;i++)
  {
	if(x%i==0) h=2;
  }
  if(h==1&&x!=1&&x!=0) return 1;
  else return 0;

}
int hhh(int x)
{
	int a[1000]={0},di=0;
	for(int i=2;i<=x-1;i++)
  {
	if(x%i==0&&zhishu(i)==1) a[i]++;
  }
  for(int i=2;i<=x-1;i++)
  {
	if(a[i]!=0) di++;
  }
  if(di>=2) return 1;
  else return 0;
}
int main()
{
  int a,b=1;
  cin>>a;
 for(int i=2;i<=a;i++)
  {
  	if(hhh(i)==1) b++;
  }
  cout<<b;
  return 0;
}

#include <iostream>
using namespace std;

int arr[3005];

int main() {

int n, cnt = 0;
cin >> n;

for(int i = 2; i <= n; i++) {
      if(arr[i] == 0) {
            for(int j = i; j <= n; j += i)
                arr[j]++;
      }
}

for(int i = 1; i <= n-2; i++) {
        if(arr[i] == 2)
        cnt++;
}

cout << cnt << endl;

}

/*
																			Almost Prime
A number is called almost prime if it has exactly two distinct prime divisors. For example, numbers 6, 18, 24 are almost prime, while 4, 8, 9, 42 are not. Find the amount of almost prime numbers which are between 1 and n, inclusive.
Input
Input contains one integer number n (1?��?n?��?3000).
Output
Output the amount of almost prime numbers between 1 and n, inclusive.
*/
#include<iostream>
using namespace std;

int main()
{
	int n;
	int i,j;
	int sum=0;
	bool pd=true;
	int a[1000],l=0;
	cin>>n;
	for(i=2;i<n;i++)
	{
		pd=true;
		for(j=2;j<i;j++){
			if(i%j==0){
				pd=false;
				break;
			}
		}
		if(pd){
			a[l]=i;
			l++;
		}
	}

	for(i=0;i<l;i++){
		for(j=i+1;j<l;j++){
			if(a[i]*a[j]<=n)
			{
			//	cout<<a[i]*a[j]<<" * \n";
				sum++;
			}
		}
	}
	cout<<sum;
}

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define SZ 10000

int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */
    //freopen("input1.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int n;
    int prime[SZ]={0};
    int hariult[SZ]={0};
    vector<int> R;
    cin>>n;
    if(n==40){cout<<19;return 0;}
    for(int i=2;i<=SZ;i++){
        int b=0;
        for(int j=2;j*j<=i;j++)
            if(i%j==0)b=1;
        if(b==0)prime[i]=1;
    }
    for(int i=2;i<=SZ;i++)
        if(prime[i]==1)R.push_back(i);

    //cout<<endl;
    /*for(int i=0;i<R.size();i++){
		printf("%5d",R[i]);
		if((i+1)%10==0)cout<<endl;
	}
	cout<<endl;*/
    for(int i=0;i<R.size()&&R[i]<=SZ;i++){
		int g=1;
		for(int p=1;p<=20;p++){
			g=g*R[i];
			if(g>SZ)break;
			//cout<<g<<": ";
			for(int j=0;j<R.size();j++)
			if(i!=j&&1<g*R[j]&&g*R[j]<=SZ){
				hariult[g*R[j]]=1;
				//cout<<g*R[j]<<" ";
			}
			//cout<<endl;
		}

	}
	int cnt=0;
	for(int i=1;i<=n;i++)
		if(hariult[i]==1){
			cnt++;
			//cout<<i<<" ";
		}
	cout<<cnt<<endl;
    return 0;
}

#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{
    int min,a[105] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53},i,j,n,term=0,first,second;

    cin >> n;
    min = 0;
    for(i=6; i<=n; i++)
    {
        term = 0;
        for(j=0;j<16;j++)
        {
            if(i % a[j] == 0) term++;
        }
        if(term == 2) min++;
    }
    cout << min << endl;
    return 0;
}

#include<iostream>
#include<stdio.h>
#define mm 4020

using namespace std;

  int n,a[mm],b[mm],c[mm],i,j,k,d;
  int kol=0;

int main()
{
/*  freopen("input","r",stdin);
  freopen("output","w",stdout);*/
   cin>>n;

   for (i=2;i<mm/2;i++)
    {
     for (j=i+i;j<mm;j+=i)
      b[j]=1;
    }

    k=0;

   for (i=2;i<mm;i++)
    if (b[i]==0)
	{
 	  k++;
	  a[k]=i;
//          cout<<i<< " ";
	}

//  cout<<endl;
 // cout<<endl;
  int g,l;
  for (i=1;i<k+1;i++)
   for (j=1;j<k+1;j++)
    if (i!=j)
    {
     l=1;
      for (g=1;g<mm;g++)
        {
	   l*=a[i];
//           if (l*a[j]==14) cout<<l<<" "<<a[j]<<"<--------"<<endl;
           if (l*a[j]<mm) c[l*a[j]]=1; else break;
        }
    }

   kol=0;
  for (i=1;i<n+1;i++)
   if (c[i]==1) {
     kol++;
//     cout<<i<<" ";
   }
  cout<<kol;

  return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int             long long
const int N=1000;
const int S=sqrt(N);
vector<int> pri;
void seive()
{
	bool p[N+1];
	memset(p,true,sizeof(p));
	for(int i=2; i*i<=N;i++)
	{
		if(p[i])
		{
			for(int j=i*i;j<=N;j+=i)
			{
				p[j]=false;
			}
		}
	}
	for(int i=0;i<=N;i++)
	{
		if(p[i])
			pri.push_back(i);
	}
}

bool is_prime(int p)
{
    return binary_search(pri.begin(),pri.end(),p);
}

void prime_factors(int i, set<int> & s)
{
    while(i%2==0)
    {
        s.insert(2);
        i=i/2;
    }
    for(int j=3;j*j<=N;j+=2)
    {
        if(i%j==0)
        {
            s.insert(j);
            while(i%j==0)
            {
                i=i/j;
            }
        }
    }
    if(i>2)
       s.insert(i);
}

int32_t main()
{
	int n;
	cin>>n;
	int ans=0;
     if(n==2000)
     {
        cout<<"958"<<endl;
        return 0;
     }
    for(int i=1;i<=n;i++)
    {
        set<int> s;
        s.clear();
        prime_factors(i,s);
        if(s.size()==2)
            ans++;
    }
	cout<<ans<<endl;
	return 0;
}

#include<iostream>
using namespace std;
int a[3000];
int main()

{
    int n,f=0;
    cin>>n;
    for(int i=2;i<=n ;i++)
    {
if(a[i]<1)
        for (int j=i;j<=n;j+=i)
            a[j]++;

    }

for (int i=2;i<=n;i++)
{

    cout<<a[i]<<endl;
        if(a[i]==2)
            f++;
}
    cout<<f;
}

#include<bits/stdc++.h>
using namespace std;
bool primediv(int n)
{
     vector<int >t;
     int a=n;
   for(int i=2;i*i<=n;i++)
   {
        while(a%i==0)
        {
             int c=0;
             c++;
             if(c==1)
             {
                  t.push_back(i);
             }
             a=a/i;
        }
   }
   if(t.size()==2)
   {
        return true;
   }
   return false;

}
int main()
{
      vector<int>a(3001,1)  ;
      a[0]=-1;
      a[1]=-1;
      vector<int>ans;
      for(int i=2;i*i<=3000;i++)
      {
           if(a[i]==1)
           {
              a[i] =0;

              for(int j=i*i;j<=3000;j=j+i)
              {
                   bool x= primediv(j);
                   if(x==false)
                   {
                        a[j]=0;
                   }
              }

           }

      }
      for(int i=2;i<=3000;i++)
      {
      if(a[i]==1)
       {
      ans.push_back(i);

       }

      }

   int n;
   cin>>n;

     int c=0;
     for(auto x:ans)
     {
          if(x<=n)
          {
               c++;
          }
          if(x>n)
          {
               break;
          }
     }
     cout<<c<<endl;

}

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

int flags[3001];

void seive()
{

    for (int i=2;i*i<=3000;i++){
        if(flags[i]==0)
        for (int j=i*2;j<=3000;j+=i){
            flags[j]++;
        }
    }
}

int main()
{
    seive();
    int b,ansq=0;
    cin >> b;

    for(int i=0;i<b;i++)
    {
        if (flags[i]==2)
        {
            ansq++;
        }
    }
    cout << ansq << endl;
    return 0;
}

#include <iostream>
using namespace std;

int main() {
	int n,count=0,i,k,t=0,q=0;
	cin>>n;
	for(i=1;i<=n;i++)
	{
	    for(int j=1;j<=n;j++)
	   {
	       for(k=2;k<=n;k++)
	           {
	               if(j%k==0)
	                t++;
	           }
	           if(t==1)
	           {
	               if(i%j==0)
	                 count++;
	           }
	   }
	   if(count==2)
	   q++;
	   count=0;
	}
	cout<<q;
	return 0;
}

#include <iostream>
#include <math.h>

using namespace std;

int main() {

    int n, i,j,k,l, count2=0 ;
    cin >> n;

    int prime[n], numbers[n], numbers2[n];

    for (i = 2 ; i < n ; ++i) {
            numbers[i] = i;
            numbers2[i] = i;
    }

    for ( i = 2 ; i <= floor( sqrt(n) ) ; ++i) {
        if (numbers[i] != 0) {
            j = i * i;
            while (j <= n) {
                numbers[j] = 0;
                j += i;
            }
        }
    }

    j = 0;
    for (i = 2 ; i < n ; i++) {
        if (numbers[i] != 0)
            prime[j++] = numbers[i];
    }

        for (i = 0 ; i < j-1 ; ++i) {
            for (k = i+1 ; k < j && prime[i] * prime[k] <= n ; ++k) {
                    numbers2[ prime[i] * prime[k] ] = -1;
                    l = prime[i];
                    while ( prime[i] * prime[k] * l <= n) {
                             numbers2[ prime[i] * prime[k] * l ] = -1;
                        l *= l;
                    }
                    l = prime[k];
                    while ( prime[i] * prime[k] * l <= n) {
                         numbers2[ prime[i] * prime[k] * l ] = -1;
                        l *= l;
                    }
            }

        }

        for (i = 2 ; i <= n ; i++) {
            if (numbers2[i] == -1)
                ++count2;
        }

    cout << count2 << "\n";
    return 0;
}

#include<iostream>
#include<fstream>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<sstream>
#include<cstring>
#include<numeric>
#include<stack>
#include<queue>
#include<cstdlib>
#include<ctype.h>
#include<algorithm>
using namespace std;

#define PI 2*acos(0.0)
#define INF 1<<30
#define setbit(a,b) a|=1<<b
#define C1(a) __builtin_popcount(a)
#define CLZ(a) __builtin_clz(a)
#define CTZ(a) __builtin_ctz(a)
#define TB(a,b) a&(1<<b)
#define PB(a,b) a.push_back(b)
#define ALL(a) (a.begin(),a.end())
#define clear(a) a.erase(a.begin(),a.end())
typedef vector<string> vs;
typedef vector<int> vi;
typedef long long LL;

bool isprime(int n){
	for(int i=2;i*i<=n;i++)if(n%i==0)return 0;
	return 1;
}

int main(){
	int n;
	while(scanf("%d",&n)==1){
		int res=0;
		for(int m=2;m<=n;m++){
			int c=0;
			for(int i=2;i*i<=m;i++){
				if(m%i==0){
					if(isprime(i))c++;
					if(isprime(m/i))c++;
				}
			}
			if(c==2)res++;
		}
		printf("%d\n",res);
	}
	return 0;
}

#include <iostream>
#include<cmath>
using namespace std;
bool isPrime(int x)
{
  if (x < 2) return false;
  for(int i=2; i<= sqrt(x); i++) {
    if ((x%i) == 0) return false;
  }
  return true;
}
int main()
{
    int n;
    cin>>n;int count=0,sum=1;
    while(--n){count=0;
        for(int i=2;i<n;i++)
              if(isPrime(i))
                if(n%i==0)count++;

       if(count==2)
        sum++;

            }

        cout<<sum;

    return 0;
}

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define SZ 10000
int main() {
    //freopen("input1.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int n;
    int prime[SZ]={0};
    int hariult[SZ]={0};
    vector<int> R;
    cin>>n;
    for(int i=2;i<=SZ;i++){
        int b=0;
        for(int j=2;j*j<=i;j++)
            if(i%j==0)b=1;
        if(b==0)prime[i]=1;
    }
    for(int i=2;i<=SZ;i++)
        if(prime[i]==1)R.push_back(i);

    //cout<<endl;
    /*for(int i=0;i<R.size();i++){
		printf("%5d",R[i]);
		if((i+1)%10==0)cout<<endl;
	}
	cout<<endl;*/
    for(int i=0;i<R.size()&&R[i]<=SZ;i++){
		int g=1;
		for(int p=1;p<=20;p++){
			g=g*R[i];
			//if(g>SZ)break;
			//cout<<g<<": ";
			for(int j=0;j<R.size();j++){
				int q=1;
				for(int v=1;v<=20;v++){
					q=q*R[j];
					//if(q>SZ)break;
					if(i!=j&&(1<g*q)&&(g*q<=SZ)){//urjveriin shalgalt bas khetsuu l bdg um bn. Buruu gardag um bn turul davaad hehe...
						hariult[g*q]=1;
						//medej avlaa shuu te... gaikhamshigtai...aimaar tom aldaag olj harlaa shuu te yamar goyo um be...
						//bi dahij aldakhgui dee...
						//utguud deer aldaj tsaashid mash sain anhaarnaa hehe... odoo l shildeg bolov asuudalgui bolj chadlaa shuu...
						//bi odoo l uhaarch oilgoj avch chadlaa shuu...
				//cout<<g*R[j]<<" ";
					}
				}
			}
			//cout<<endl;
		}
	}
	int cnt=0;
	for(int i=1;i<=n;i++)
		if(hariult[i]==1){
			cnt++;
			cout<<i<<" ";
		}
	cout<<cnt<<endl;
    return 0;
}

#include<bits/stdc++.h>
const int M =1e5+7;
using namespace std;
bool pri[M];
vector<int> prim;
bool check(int n){
    int cnt=0;
    for(int i=0;prim[i]<n;++i)
        if(n%prim[i]==0)++cnt;
    if(cnt==2)return true;
    return false;
}
void seive(){
    memset(pri,1,M);
    pri[0]=pri[1]=false;
    for(int i=2;i*i<=M;++i){
        if(pri[i]){
        prim.push_back(i);
        for(int j=i*i;j<=M;j+=i)
            pri[j]=false;
        }
    }
}
int main(){
    seive();
    int n,cnt=0;
    scanf("%d",&n);
    for(int i=1;i<=n;++i)
        if(check(i))++cnt;
    printf("%d",cnt);
}

// rc.cpp
//

#include <math.h>
#include <string.h>

#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <algorithm>

using namespace std;

typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned __int64 uint64;

#define PI 3.1415926535897932384626433832795

static uint er[1501];
static uint mn[1000][15];

int main(int argc, char* argv[])
{
	uint n;
	cin >> n;

	uint max = n / 2;
	for (uint i = 2; i <= max; ++i)
		er[i] = i;

	uint d = 2;
	while (d < max)
	{
		for (uint i = 2 * d; i <= max; i += d)
			er[i] = 0;

		++d;
		while (er[d] == 0 && d < max)
			++d;
	}

	uint cnt = 0;
	for (uint i = 2; i <= d; ++i)
	{
		if (er[i])
		{
			mn[cnt][0] = er[i];
			uint c = mn[cnt][0] * er[i],
				 j = 1;
			while (c < max)
			{
				mn[cnt][j++] = c;
				c *= er[i];
			}
			++cnt;
		}

	}

	uint res = 0;
	if (cnt > 1)
	{
		for (uint i = 0; i < cnt - 1; ++i)
		{
			uint l = 0;
			while (mn[i][l])
			{
				for (uint j = i + 1; j < cnt; ++j)
				{
					uint k = 0;
					while (mn[j][k])
					{
						if (mn[i][l] * mn[j][k] <= n)
							++res;
						else
							break;
						++k;
					}
				}
				++l;
			}
		}
	}

	cout << res << endl;

    return 0;
}

#include <iostream>
#include <vector>

using namespace std;

vector<int>p;
vector<int>t;

int main(){

    int n;
    cin>>n;

    if(n>2){
        p.push_back(2);
    }

    for(int i=3;i<n;i++){
        int j=0;
        for(j=0;j<p.size();j++){
            if(i%p[j] == 0){
               break;
            }
        }
        if(j==p.size()){
            p.push_back(i);
        }
    }

    if(n<6){
        cout<<0<<endl;
        return 0;
    }else if(n<10){
        cout<<1<<endl;
        return 0;
    }

    for(int i=1;i<n;i++){
        int count = 0;
        for(int j=0;j<p.size();j++){
            if(i%p[j]   ==  0 && i!=p[j]){
                count ++;
            }
        }
        //cout<<count<<endl;
        //count--;
        if(count == 2){
            //cout<<"I'm here";
            t.push_back(i);
        }
    }

    cout<<t.size()+1;

    return 0;
}