#include <bits/stdc++.h>
using namespace std;
long long p[10], n, res;
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  p[1] = 2;
  p[2] = 3;
  p[3] = 5;
  p[4] = 7;
  res = 0;
  for (int a = 1; a <= 4; a++) res += n / p[a];
  for (int a = 1; a <= 4; a++)
    for (int b = a + 1; b <= 4; b++) res -= n / (p[a] * p[b]);
  for (int a = 1; a <= 4; a++)
    for (int b = a + 1; b <= 4; b++)
      for (int c = b + 1; c <= 4; c++) res += n / (p[a] * p[b] * p[c]);
  for (int a = 1; a <= 4; a++)
    for (int b = a + 1; b <= 4; b++)
      for (int c = b + 1; c <= 4; c++)
        for (int d = c + 1; d <= 4; d++) res -= n / (p[a] * p[b] * p[c] * p[d]);
  res = n - res;
  cout << res << "\n";
  return 0;
}
