bool isprime(int x)
{
if(x < 2) return 0;
for(int i = 2; i <= x / i; i++)
if(x % i == 0)
return 0;
return 1;
}
#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
int n, cnt = 0;
bool a[100000005];
void sf(int x)
{
memset(a, 1, sizeof a);
a[0] = a[1] = 0;
for(int i = 2; i <= x; i++)
{
if(a[i] == 1)
{
cnt++;
for(int j = i + i; j <= x; j += i)
{
a[j] = 0;
}
}
}
}
int main()
{
cin >> n;
sf(n);
cout << cnt << "\n";
return 0;
}
#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
int n, cnt = 0;
bool a[100000005];
void sf(int x)
{
memset(a, 1, sizeof a);
a[0] = a[1] = 0;
for(int i = 2; i <= x; i++)
{
if(a[i] == 1)
{
cnt++;
for(int j = i + i; j <= x; j += i)
{
a[j] = 0;
}
}
}
}
int main()
{
cin >> n;
sf(n);
cout << cnt << "\n";
return 0;
}