#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int one = (n / 2) + (n / 3) + (n / 5) + (n / 7),
                two = (n / 6) + (n / 10) + (n / 14) + (n / 15) + (n / 21) +
                      (n / 35),
                three = (n / (2 * 3 * 5)) + (n / (3 * 5 * 7)) +
                        (n / (2 * 5 * 7)) + (n / (2 * 3 * 7)),
                four = (n / (2 * 3 * 5 * 7));
  cout << n - one + two - three + four;
  return 0;
}
