#include <bits/stdc++.h>
int main() {
  long long n, w = 0, i, j, k;
  bool y[1261] = {0};
  scanf("%I64d", &n);
  k = 1260;
  for (i = 2; i <= 10; i++)
    for (j = 1; j <= 1260; j++)
      if (j % i == 0 && y[j] == 0) {
        y[j] = 1;
        k--;
      }
  w = 0;
  w = n / 1260 * k;
  n %= 1260;
  for (i = 1; i <= n; i++)
    if (y[i] == 0) w++;
  printf("%I64d", w);
  return 0;
}
