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

int check[1000000 + 5];

void sieve()
{
check[1] = 1;
for(int i = 4; i <= 1000000; i += 2)
check[i] = 1;
for(int i = 3; i <= 1000; i += 2)
for(int j = i * i; j <= 1000000; j += i + i)
check[j] = 1;
for(int i = 1; i <= 1000000; i++)
check[i] += check[i - 1];
}

int main()
{
sieve();
int n;
while(cin >> n)
cout << n - check[n] << endl;
return 0;
}