#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  int a = 2, b = 3, c = 5, d = 7;
  int ab = 6, ac = 10, ad = 14, bc = 15, bd = 21, cd = 35;
  int abc = 30, bcd = 105, abd = 42, acd = 70;
  int abcd = 210;
  cout << n - (n / a + n / b + n / c + n / d) +
              (n / ab + n / ac + n / ad + n / bc + n / bd + n / cd) -
              (n / abc + n / bcd + n / abd + n / acd) + n / abcd;
}
