#include <bits/stdc++.h>
using namespace std;
const double eps = 0.01;
const double pi = 3.141592653589;
const long long mod = 1000000007;
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  while (a != 0 && b != 0) {
    b %= a;
    swap(a, b);
  }
  return a + b;
}
long long poww(long long v, long long p) {
  if (p == 0) return 1;
  if (p & 1) {
    return (poww(v, p - 1) * v) % mod;
  } else {
    long long t = poww(v, p / 2);
    return (t * t) % mod;
  }
}
void calc_primes(int n, vector<bool> &primes) {
  primes.resize(n, true);
  primes[1] = false;
  for (int i = 2; i * i < n; ++i) {
    if (!primes[i]) continue;
    for (int j = i * i; j < n; j += i) {
      primes[j] = false;
    }
  }
}
long long ext_gcd(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long x1, y1;
  long long d = ext_gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
bool vect_comp(pair<int, int> a, pair<int, int> b) {
  return (a.first * b.second - a.second * b.first > 0);
}
bool get_bit(int &v, char &num) { return ((v >> num) & 1); }
void set_bit(int &v, char &num) { v = v | (1 << num); }
int count_bit(int v) {
  int cnt = 0;
  while (v > 0) {
    cnt += v & 1;
    v = v >> 1;
  }
  return cnt;
}
long long n, m, p, g, w;
long long t;
long long res;
int k;
long long arr[210];
int main() {
  cin >> t;
  for (int i = 1; i < 211; ++i) {
    arr[i] = arr[i - 1];
    if (i % 2 != 0 && i % 3 != 0 && i % 5 != 0 && i % 7 != 0) {
      arr[i]++;
    }
  }
  cout << arr[210] * (t / 210) + arr[t % 210];
  return 0;
}
