#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
int main() {
  long long n, res = 0;
  cin >> n;
  long long a = 2, b = 3, c = 5, d = 7;
  res += n / a + n / b + n / c + n / d + n / lcm(a, lcm(b, c)) +
         n / lcm(a, lcm(b, d)) + n / lcm(a, lcm(c, d)) + n / lcm(b, lcm(c, d));
  res -= n / lcm(a, b) + n / lcm(a, c) + n / lcm(a, d) + n / lcm(b, c) +
         n / lcm(b, d) + n / lcm(c, d) + n / lcm(a, lcm(b, lcm(c, d)));
  cout << n - res << endl;
  return 0;
}
