#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int n, ans, twos, threes, fives, sevens;
  cin >> n;
  twos = n / 2;
  threes = n / 3 - n / 6;
  fives = n / 5 - n / 10 - (n / 15 - n / 30);
  sevens = n / 7 - n / 14 - (n / 21 - n / 42) - (n / 35 - n / 70 - n / 105) -
           n / 210;
  ans = n - twos - threes - fives - sevens;
  cout << ans;
  return 0;
}
