#include <bits/stdc++.h>
using namespace std;
template <class T>
T min(T a, T b, T c) {
  return min(a, min(b, c));
}
template <class T>
T max(T a, T b, T c) {
  return max(a, max(b, c));
}
long long ind[2521], d[2521], n;
int main() {
  for (int i = (1); i <= (2520); ++i) {
    bool ok = true;
    for (int j = (2); j <= (10); ++j) {
      if (i % j == 0) {
        ok = false;
        break;
      }
    }
    ind[i] = ok;
  }
  for (int i = (1); i <= (2520); ++i) d[i] = d[i - 1] + ind[i];
  cin >> n;
  cout << (n / 2520) * d[2520] + d[n % 2520];
  return 0;
}
