#include <bits/stdc++.h>
using namespace std;
map<vector<long long>, long long> mp;
int main() {
  long long n;
  cin >> n;
  long long a[] = {2, 3, 5, 7};
  vector<long long> t;
  for (long long mask = 1; mask < (1 << 4); mask++) {
    t.clear();
    for (long long j = 0; j < 4; j++) {
      if (mask & (1 << j)) t.push_back(a[j]);
    }
    sort(t.begin(), t.end());
    long long y = 1;
    for (auto v : t) y *= v;
    mp[t] += n / y;
  }
  for (auto x : mp) {
    if (x.first.size() % 2) {
      n -= x.second;
      continue;
    }
    n += x.second;
  }
  cout << n << endl;
  return 0;
}
