#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <complex>
using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;

#ifndef typeof
#define typeof __typeof__
#endif // typeof

#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(typeof((c).rbegin()) i = (c).rbegin(); i != (c).rend(); i++)
#define repby(i, a, b, step) for(typeof(b) i = (a); i < (b); i += (step))
#define repab(i, a, b) repby(i, (a), (b), 1)
#define rep(i, n) repab(i, 0, (n))
#define pb push_back
#define sz(c) int((c).size())

vector<bool> prime_table;
vi nprimes;

void mkprime_table(int n) {
  prime_table = vector<bool>(n+1, true);
  nprimes = vi(n+1, 0);
  prime_table[0] = prime_table[1] = false;
  for (int i = 4; i <= n; i += 2) {
    prime_table[i] = false;
  }

  for (int i = 3; i*i <= n; i += 2) {
    if (prime_table[i]) {
      for (int j = 2; i*j <= n; j++) {
        prime_table[i*j] = false;
      }
    }
  }

  int total = 0;
  for (int i = 0; i <= n; i++) {
    if (prime_table[i]) {
      total++;
    }
    nprimes[i] = total;
  }
}

int main(int argc, char **argv)
{
  vi v;
  int n;

  while (cin >> n) {
    v.pb(n);
  }

  mkprime_table(*max_element(all(v)));

  tr(v, i) {
    cout << nprimes[*i] << endl;
  }

  return 0;
}