IT City company developing computer games invented a new way to reward its employees. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each transaction. Every time when the next number of sales is divisible by all numbers from 2 to 10 every developer of this game gets a small bonus.

A game designer Petya knows that the company is just about to release a new game that was partly developed by him. On the basis of his experience he predicts that n people will buy the game during the first month. Now Petya wants to determine how many times he will get the bonus. Help him to know it.


-----Input-----

The only line of the input contains one integer n (1 ≤ n ≤ 10^18) — the prediction on the number of people who will buy the game.


-----Output-----

Output one integer showing how many numbers from 1 to n are divisible by all numbers from 2 to 10.


-----Examples-----
Input
3000

Output
1

Difficulty: EASY
Tags: Number theory

Mathematics

Starter code:

Solutions:
import math
n = int(input())
k = 1
for i in range(7, 11):
	k = k * i // math.gcd(k, i)
print(n // k)


def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)

def lcm(a, b):
	return a // gcd(a, b) * b

def main():
	n = int(input())
	m = 1
	for d in range(2, 11):
		m = lcm(d, m)
	res = n // m
	print(res)
main()


n = int(input())
ans = n // 2520
print(str(ans))


n = int(input())
print(n // (8 * 9 * 5 * 7))


n = int(input())
up_to_k = 2520 * [0]
num = 0
for i in range(2520):
	for j in range(2, 11):
		if (i + 1) % j == 0:
			break
	else:
		num += 1
	up_to_k[i] = num
div = n // 2520
rem = n % 2520
if rem == 0:
	print(div * up_to_k[-1])
else:
	print(div * up_to_k[-1] + up_to_k[rem - 1])


n = int(input())
t = [False] * 2521
sum = 0
for a in range(2521):
	t[a] = a % 2 == 0 or a % 3 == 0 or a % 4 == 0 or (a % 5 == 0) or (a % 6 == 0) or (a % 7 == 0) or (a % 8 == 0) or (a % 9 == 0) or (a % 10 == 0)
	if not t[a]:
		sum += 1
ret = sum * (n // 2520)
for a in range(n % 2520 + 1):
	ret += not t[a]
print(ret)


n = 0

def add(x, y):
	m = int(pow(-1, x))
	return m * (n // y)
n = int(input())
a = n
a += add(1, 2)
a += add(1, 3)
a += add(1, 5)
a += add(1, 7)
a += add(0, 2 * 3)
a += add(0, 2 * 5)
a += add(0, 2 * 7)
a += add(0, 3 * 5)
a += add(0, 3 * 7)
a += add(0, 5 * 7)
a += add(1, 2 * 3 * 5)
a += add(1, 2 * 3 * 7)
a += add(1, 2 * 5 * 7)
a += add(1, 3 * 5 * 7)
a += add(0, 2 * 3 * 5 * 7)
print(a)


n = int(input())
ans = n - (n // 2 + n // 3 + n // 5 + n // 7 - n // 6 - n // 10 - n // 14 - n // 15 - n // 21 - n // 35 + n // 30 + n // 42 + n // 70 + n // 105 - n // 210)
print(ans)


n = int(input())
print(n // 2520)


import math
n = int(input())
c = n / 2520
c = int(math.floor(c))
print(c)


import math
n = int(input())
a = n // 2 + n // 3 + n // 5 + n // 7
b = n // 6 + n // 10 + n // 14 + n // 15 + n // 21 + n // 35
c = n // 30 + n // 42 + n // 70 + n // 105
d = n // 210
print(n - a + b - c + d)


import os, sys, pdb
import time, calendar, datetime
import math, itertools
import operator as op
from functools import reduce

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom
l = []
for i in range(2520):
	div = 1
	for j in range(2, 11):
		if i % j == 0:
			div = 0
	l.append(div)
(n,) = list(map(int, input().split()))
ans = n // 2520 * sum(l) + sum(l[:n % 2520 + 1])
print(ans)


def pol(n, k):
	ans = 1
	for i in range(k):
		ans *= (n - i) / (i + 1)
	k = int(ans)
	if abs(k - ans) < 1 / 2:
		return k
	return k + 1
n = int(input())
d = 9 * 8 * 7 * 5
print(int(n / d))


a = int(input())
print(int(a / 2520))


import math
n = int(input())
print(math.floor(n / (8 * 9 * 5 * 7)))


M = 2 * 3 * 5 * 7
v = [0] * M
for i in range(1, M):
	v[i] = v[i - 1] + bool(i % 2 and i % 3 and i % 5 and i % 7)
n = int(input())
print(n // M * v[-1] + v[n % M])


n = int(input())
print(n // (2 * 3 * 2 * 5 * 1 * 7 * 2 * 3))


import sys
from collections import Counter

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip('\n')
n = int(input())
print(n - n // 2 - n // 3 - n // 5 - n // 7 + n // 6 + n // 10 + n // 14 + n // 15 + n // 21 + n // 35 - n // 30 - n // 42 - n // 70 - n // 105 + n // 210)


c = int(input())
print(c // 2520)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
from math import gcd
from bisect import bisect
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def mul(arr):
	ans = 1
	for i in arr:
		ans *= i
	return ans

def solve():
	n = int(input())
	t = n
	primes = [2, 3, 5, 7]
	for i in range(1, 4):
		for j in combinations(primes, i):
			if i % 2:
				n -= t // mul(list(j))
			else:
				n += t // mul(list(j))
	n += t // mul(primes)
	print(n)
solve()


n = int(input())
p = n // 2520
print(p)


def test():
	num = -1
	for i in range(10, 3000):
		ok = 1
		for j in range(2, 10):
			if i % j != 0:
				ok = 0
				break
		if ok == 1:
			num = i
			break
	return num
d = test()
n = int(input())
print(n // d)


def main():
	n = int(input())
	one = n // 2 + n // 3 + n // 5 + n // 7
	two = n // (2 * 3) + n // (2 * 5) + n // (2 * 7) + n // (3 * 5) + n // (3 * 7) + n // (5 * 7)
	three = n // (2 * 3 * 5) + n // (2 * 3 * 7) + n // (2 * 5 * 7) + n // (3 * 5 * 7)
	four = n // (2 * 3 * 5 * 7)
	print(n - one + two - three + four)
main()


import math
from math import *
n = int(input())
d = [2, 3, 5, 7]
ans = n
for i in range(4):
	ans -= n // d[i]
for i in range(4):
	for j in range(i + 1, 4):
		ans += n // (d[i] * d[j])
for i in range(4):
	for j in range(i + 1, 4):
		for k in range(j + 1, 4):
			ans -= n // (d[i] * d[j] * d[k])
ans += n // (2 * 3 * 5 * 7)
print(ans)


n = int(input())
menor = 2520
print(n // menor)


a = int(input())
b = a - a // 2 - a // 3 - a // 5 - a // 7 + a // 6 + a // 10 + a // 14 + a // 15 + a // 21 + a // 35 - a // 30 - a // 42 - a // 70 - a // 105 + a // 210
print(b)


a = int(input())
u = 3 * 5 * 7 * 8 * 3
print(a // u)


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

def lcm(a, b):
	return a * b // gcd(a, b)

def solve():
	mul = lcm(2, lcm(3, lcm(4, lcm(5, lcm(6, lcm(7, lcm(8, lcm(9, 10))))))))
	n = int(input())
	print(n // mul)
for _ in range(1):
	solve()


n = int(input())
ost = n // 2520
ans = 0
for i in range(1, n % 2520 + 1):
	if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 or (i % 7 == 0):
		ans += 1
print(ost * 576 + n % 2520 - ans)


x = input()
x = int(x)
print(x // 2520)


def test(x):
	return not any([x % i == 0 for i in list(range(2, 11))])
N = int(input())
CP = 2 ** 3 * 3 ** 2 * 5 * 7
toCP = 0
for i in range(1, CP + 1):
	if test(i):
		toCP += 1
ans = int(N / CP) * toCP
for i in range(int(N / CP) * CP + 1, N + 1):
	if test(i):
		ans += 1
print(ans)


import math
DIV = 2520
n = int(input())
print(math.floor(n / 2520))


a = 2520
n = int(input())
print(n // a)


from math import ceil
n = int(input())
x = 2520
print(max(int(n / x) - ceil(1 / x) + 1, 0))


n = int(input())
k = n // 2520
print(k)


s = [2, 3, 5, 7]
n = int(input())
ans = 0
for i in s:
	ans += n // i
for i in range(len(s)):
	for j in range(i + 1, len(s)):
		ans -= n // (s[i] * s[j])
for i in range(len(s)):
	for j in range(i + 1, len(s)):
		for k in range(j + 1, len(s)):
			ans += n // (s[i] * s[j] * s[k])
ans -= n // (2 * 3 * 5 * 7)
print(n - ans)


from itertools import combinations, accumulate, groupby, count
from sys import stdout, stdin, setrecursionlimit
from io import BytesIO, IOBase
from collections import *
from random import *
from bisect import *
from string import *
from queue import *
from heapq import *
from math import *
from os import *
from re import *

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))

def fast():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in fast().split()]
(z, zz) = (fast, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer, end='\n'):
	stdout.write(str(answer) + end)
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
n = int(z())
s = 0
for i in range(2520):
	ans = True
	if i % 2 == 0 or i % 3 == 0 or i % 5 == 0 or (i % 7 == 0):
		ans = False
	if ans and i <= n:
		s += (n - i) // 2520
		s += 1
print(s)


print(int(input()) // 2520)


a = int(input())
an = 0
l = [2, 3, 5, 7]
for _ in range(1 << 4):
	(p, c) = (1, 0)
	for i in range(4):
		if _ & 1 << i:
			p *= l[i]
			c += 1
	if c & 1:
		an -= a // p
	else:
		an += a // p
print(an)


a = int(input())
lcm = 2 ** 3 * 3 ** 2 * 5 * 7
print(a // lcm)


from sys import stdin
num = int(stdin.readline())
K = 2520
print(num // K)


def is_divisible(n):
	nums = [2, 3, 5, 7]
	for num in nums:
		if n % num == 0:
			return True
	return False

def main(n):
	pay_days = 0
	for i in range(1, n + 1, 2):
		if not is_divisible(i):
			pay_days += 1
	print(pay_days)

def brian_way(n):
	nums = [2, 3, 5, 7]
	two_combos = [6, 10, 14, 15, 21, 35]
	three_combos = [30, 105, 70, 42]
	four_combo = [210]
	final_number = n
	for num in nums:
		final_number -= n // num
	for two in two_combos:
		final_number += n // two
	for three in three_combos:
		final_number -= n // three
	final_number += n // four_combo[0]
	print(final_number)
n = int(input())
brian_way(n)


n = int(input())
d = 2 * 3 * 2 * 5 * 7 * 2 * 3
print(n // d)


def main():
	print(int(input()) // 2520)
main()


n = int(input())
primes = [2, 3, 5, 7]
ans = 0
for msk in range(1 << len(primes)):
	p = 1
	sign = 1
	for i in range(len(primes)):
		if msk & 1 << i:
			p *= primes[i]
			sign *= -1
	ans += n // p * sign
print(ans)


n = int(input())
abcdefghijklmnop = n // 2520
print(abcdefghijklmnop)


nok = 8 * 9 * 5 * 7
print(int(input()) // nok)


x = int(input())
if x < 2520:
	w = 0
else:
	w = int(x / 2520)
print(w)


n = eval(input())
print(int(n // (2 * 4 * 9 * 7 * 5)))


n = int(input())
mod = 2 * 2 * 2 * 3 * 3 * 5 * 7
print(n // mod)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)
L = 1
for i in range(2, 11):
	L = lcm(L, i)
n = int(input())
print(n // L)


x = int(input())
cont = 0
if x > 5000:
	cont1 = int(x / 2520)
	print(cont1)
else:
	for i in range(1, x + 1, 1):
		if i % 6 == 0 and i % 7 == 0 and (i % 8 == 0) and (i % 9 == 0) and (i % 10 == 0):
			cont = cont + 1
	print(cont)


import math
n = int(input())
li = [x for x in range(2, 11)]
print(math.floor(n / 2520))


s = str(input())
print(int(s) // 2520)


n = int(input())
a = 2
b = 3
c = 5
d = 7
print(n - n // a - n // b - n // c - n // d + n // (a * b) + n // (a * c) + n // (a * d) + n // (b * c) + n // (b * d) + n // (c * d) - n // (a * b * c) - n // (a * b * d) - n // (a * c * d) - n // (b * c * d) + n // (a * b * c * d))


def precalc(st, end):
	count = 0
	for i in range(st, end + 1):
		if not any((i % k == 0 for k in [2, 3, 5, 7])):
			count += 1
	return count
n = int(input())
buckets = 2 * 3 * 4 * 5 * 6 * 7
c = int(n / buckets)
res = c * precalc(1, buckets) + precalc(c * buckets + 1, n)
print(res)


from math import sqrt
n = int(input())
res = int(n / 2520)
print(res)


print((lambda x: x // 2520)(int(input())))


numero = int(input())
contador = int(numero / 2520)
print(contador)


import math
a = 1
for x in range(2, 11):
	a = a * x // math.gcd(a, x)
n = int(input())
print(n // a)


from math import gcd
g = 2
for i in range(3, 11):
	g = g * i // gcd(i, g)
print(int(input()) // g)


import sys
import math

def main():
	n = int(input())
	a = n // 2
	b = n // 3
	c = n // 5
	d = n // 7
	ab = n // 6
	ac = n // 10
	ad = n // 14
	bc = n // 15
	bd = n // 21
	cd = n // 35
	abc = n // 30
	abd = n // 42
	acd = n // 70
	bcd = n // 105
	abcd = n // 210
	v = a + b + c + d - ab - ac - ad - bc - bd - cd + abc + abd + acd + bcd - abcd
	print(n - v)
main()


num = int(input().strip())
print(num - (num // 2 + num // 3 - num // 6 + num // 5 - num // 10 - num // 15 + num // 30 + num // 7 - num // 14 - num // 21 + num // 42 - num // 35 + num // 70 + num // 105 - num // 210))


x = int(input())
r = x // 2520
print(r)


n = int(input())
a = [2, 3, 5, 7]
ans = n
for i in a:
	ans -= n // i
for i in range(len(a)):
	for j in range(i + 1, len(a)):
		ans += n // (a[i] * a[j])
for i in range(len(a)):
	for j in range(i + 1, len(a)):
		for k in range(j + 1, len(a)):
			ans -= n // (a[i] * a[j] * a[k])
for i in range(len(a)):
	for j in range(i + 1, len(a)):
		for k in range(j + 1, len(a)):
			for l in range(k + 1, len(a)):
				ans += n // (a[i] * a[j] * a[k] * a[l])
print(ans)


from functools import reduce
from math import factorial
n = int(input())
print(n - n // 2 - n // 3 - n // 5 - n // 7 + n // 14 + n // 6 + n // 10 + n // 15 + n // 21 + n // 35 - n // 30 - n // 70 - n // 42 - n // 105 + n // 210)


print(int(input()) // (2 * 3 * 2 * 5 * 7 * 2 * 3))


n = int(input())
sum = 0
if n >= 2520:
	sum += n // 2520
print(sum)


from sys import stdin, stderr

def readInts():
	return map(int, stdin.readline().strip().split())

def print_err(*args, **kwargs):
	print(*args, file=stderr, **kwargs)

def solve(n):
	v = 2 * 3 * 2 * 5 * 7 * 2 * 3
	return n // v

def run():
	(n,) = readInts()
	print(solve(n))
run()


theset = [2, 3, 5, 7]

def brute(cur, i, n):
	res = 0
	if i < len(theset):
		res += brute(cur, i + 1, n)
		cur.append(theset[i])
		res += brute(cur, i + 1, n)
		cur.pop()
	else:
		k = 1
		for elem in cur:
			k *= elem
		res += (+1 if len(cur) % 2 == 0 else -1) * (n // k)
	return res
n = int(input())
print(brute([], 0, n))


n = int(input())
p = n - n // 2 - n // 3 - n // 5 - n // 7
c2 = n // 6 + n // 10 + n // 14 + n // 15 + n // 21 + n // 35
c3 = n // 30 + n // 42 + n // 70 + n // 105
c4 = n // (2 * 3 * 5 * 7)
p = p + c2 - c3 + c4
print(p)


import sys
input = sys.stdin.buffer.readline
n = int(input())
divisable = n // 2 + n // 3 + n // 5 + n // 7 - n // 6 - n // 10 - n // 14 - n // 15 - n // 21 - n // 35 + n // 30 + n // 42 + n // 70 + n // 105 - n // 210
print(n - divisable)


import sys
input = sys.stdin.readline
import bisect
from math import *

def bo(i):
	return ord(i) - ord('a')
n = int(input())
a = [i for i in range(1, 11)]

def lcm(a):
	g = a[0]
	for i in range(1, 10):
		g = g * a[i] // gcd(g, a[i])
	return g
l = lcm(a)
print(n // l)


import math
n = int(input())
answer = n // 2520
print(answer)


def indivisibility(n):
	return n - (n // 2 + n // 3 + n // 5 + n // 7) + (n // 6 + n // 10 + n // 14 + n // 15 + n // 21 + n // 35) - (n // 30 + n // 42 + n // 105 + n // 70) + n // 210
n = int(input())
print(indivisibility(n))


t = 2520
print(int(input()) // t)


from itertools import combinations
n = int(input().rstrip())
dividends = [2, 3, 5, 7]
inner_count = 0
for a in range(len(dividends)):
	inner_count += n // dividends[a]
for arr in combinations(dividends, 2):
	inner_count -= n // (arr[0] * arr[1])
for arr in combinations(dividends, 3):
	inner_count += n // (arr[0] * arr[1] * arr[2])
for arr in combinations(dividends, 4):
	inner_count -= n // (arr[0] * arr[1] * arr[2] * arr[3])
print(n - inner_count)


incl = [2, 3, 5, 7, 30, 42, 70, 105]
excl = [6, 10, 14, 15, 21, 35, 210]
n = int(input())
answ = 0
for k in incl:
	answ += n // k
for k in excl:
	answ -= n // k
print(n - answ)


factor = 2520
n = int(input())
res = n // factor
print(res)


gcd = lambda b, s: b if s == 0 else gcd(s, b % s)
lcm = lambda a, b: a * b // gcd(a, b)

def f(n):
	x = 10
	for i in range(9, 1, -1):
		x = lcm(x, i)
	return n // x
n = int(input())
print(f(n))


import bisect
from itertools import accumulate
import os
import sys
import math
from decimal import *
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def SieveOfEratosthenes(n):
	prime = []
	primes = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if primes[p] == True:
			prime.append(p)
			for i in range(p * p, n + 1, p):
				primes[i] = False
		p += 1
	return prime

def primefactors(n):
	fac = []
	while n % 2 == 0:
		fac.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 2):
		while n % i == 0:
			fac.append(i)
			n = n // i
	if n > 1:
		fac.append(n)
	return sorted(fac)

def factors(n):
	fac = set()
	fac.add(1)
	fac.add(n)
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			fac.add(i)
			fac.add(n // i)
	return list(fac)

def modInverse(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x
n = int(input())
print(n // 2520)


def main():
	n = int(input())
	ans = n // (2 * 2 * 2 * 3 * 3 * 5 * 7)
	print(ans)
main()


from sys import stdin
n = int(stdin.readline())
result = n // (2 * 3 * 2 * 5 * 7 * 2 * 3)
print(result)


numero = int(input(''))
print(int(numero / 2520))


from sys import stdin
n = int(stdin.readline())
result = n - n // 2 - n // 3 - n // 5 - n // 7 + n // 6 + n // 10 + n // 14 + n // 15 + n // 21 + n // 35 - n // 30 - n // 42 - n // 70 - n // 105 + n // 210
print(result)


from functools import reduce
from math import gcd
n = int(input())
lcd = reduce(lambda x, y: x * y // gcd(x, y), list(range(2, 11)))
print(n // lcd)


n = int(input())
p = 2 * 2 * 2 * 3 * 3 * 5 * 7
print(n // p)


N = int(input())
print(int(N / 2520))


def main():
	(res, n) = divmod(int(input()) + 1, 2520)
	l = [1] * n
	for p in range(2, 11):
		for i in range(0, n, p):
			l[i] = 0
	print(res * 576 + sum(l))
main()


n = int(input())
p = [2, 3, 5, 7]
d = 0
for i in p:
	d += n // i
for i in range(0, 3):
	for j in range(i + 1, 4):
		d -= n // (p[i] * p[j])
for i in range(0, 2):
	for j in range(i + 1, 3):
		for k in range(j + 1, 4):
			d += n // (p[i] * p[j] * p[k])
d -= n // 210
print(n - d)


n = 2 * 2 * 2 * 3 * 3 * 5 * 7
m = int(input())
print(m // n)


n = int(input())
neg = [2, 3, 5, 7, 2 * 3 * 5, 2 * 3 * 7, 2 * 5 * 7, 3 * 5 * 7]
pos = [1, 2 * 3, 2 * 5, 2 * 7, 3 * 5, 3 * 7, 5 * 7, 2 * 3 * 5 * 7]
ret = 0
for x in neg:
	ret -= n // x
for x in pos:
	ret += n // x
print(ret)


from math import *
n = int(input())
T = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 24, 24, 24, 24, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 34, 34, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, 41, 41, 42, 42, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 45, 45, 45, 45, 46, 46, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 48, 48, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 50, 50, 51, 51, 51, 51, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 55, 55, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 62, 62, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 65, 65, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 71, 71, 72, 72, 72, 72, 73, 73, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 79, 79, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 82, 82, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, 86, 86, 87, 87, 87, 87, 88, 88, 88, 88, 88, 88, 89, 89, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 92, 92, 93, 93, 93, 93, 94, 94, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 99, 99, 99, 99, 100, 100, 101, 101, 101, 101, 102, 102, 102, 102, 102, 102, 103, 103, 104, 104, 104, 104, 104, 104, 105, 105, 105, 105, 106, 106, 107, 107, 107, 107, 108, 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 110, 110, 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 113, 113, 114, 114, 114, 114, 114, 114, 115, 115, 115, 115, 116, 116, 116, 116, 116, 116, 117, 117, 117, 117, 117, 117, 117, 117, 118, 118, 118, 118, 119, 119, 120, 120, 120, 120, 121, 121, 122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 127, 127, 128, 128, 128, 128, 129, 129, 129, 129, 129, 129, 130, 130, 131, 131, 131, 131, 131, 131, 132, 132, 132, 132, 132, 132, 133, 133, 133, 133, 134, 134, 135, 135, 135, 135, 136, 136, 136, 136, 136, 136, 137, 137, 138, 138, 138, 138, 138, 138, 139, 139, 139, 139, 140, 140, 141, 141, 141, 141, 142, 142, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, 144, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, 147, 147, 147, 147, 148, 148, 149, 149, 149, 149, 150, 150, 150, 150, 150, 150, 151, 151, 152, 152, 152, 152, 152, 152, 153, 153, 153, 153, 154, 154, 155, 155, 155, 155, 156, 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, 157, 158, 158, 159, 159, 159, 159, 159, 159, 160, 160, 160, 160, 161, 161, 162, 162, 162, 162, 162, 162, 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, 165, 165, 165, 165, 165, 165, 165, 165, 166, 166, 166, 166, 167, 167, 168, 168, 168, 168, 169, 169, 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, 175, 175, 176, 176, 176, 176, 177, 177, 177, 177, 177, 177, 178, 178, 179, 179, 179, 179, 179, 179, 180, 180, 180, 180, 180, 180, 181, 181, 181, 181, 182, 182, 183, 183, 183, 183, 184, 184, 184, 184, 184, 184, 185, 185, 186, 186, 186, 186, 186, 186, 187, 187, 187, 187, 188, 188, 189, 189, 189, 189, 190, 190, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, 195, 195, 195, 195, 196, 196, 197, 197, 197, 197, 198, 198, 198, 198, 198, 198, 199, 199, 200, 200, 200, 200, 200, 200, 201, 201, 201, 201, 202, 202, 203, 203, 203, 203, 204, 204, 204, 204, 204, 204, 205, 205, 205, 205, 205, 205, 206, 206, 207, 207, 207, 207, 207, 207, 208, 208, 208, 208, 209, 209, 210, 210, 210, 210, 210, 210, 211, 211, 211, 211, 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, 214, 214, 215, 215, 216, 216, 216, 216, 217, 217, 218, 218, 218, 218, 219, 219, 219, 219, 219, 219, 219, 219, 220, 220, 220, 220, 220, 220, 221, 221, 221, 221, 222, 222, 222, 222, 222, 222, 223, 223, 224, 224, 224, 224, 225, 225, 225, 225, 225, 225, 226, 226, 227, 227, 227, 227, 227, 227, 228, 228, 228, 228, 228, 228, 229, 229, 229, 229, 230, 230, 231, 231, 231, 231, 232, 232, 232, 232, 232, 232, 233, 233, 234, 234, 234, 234, 234, 234, 235, 235, 235, 235, 236, 236, 237, 237, 237, 237, 238, 238, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 242, 242, 243, 243, 243, 243, 244, 244, 245, 245, 245, 245, 246, 246, 246, 246, 246, 246, 247, 247, 248, 248, 248, 248, 248, 248, 249, 249, 249, 249, 250, 250, 251, 251, 251, 251, 252, 252, 252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255, 256, 256, 256, 256, 257, 257, 258, 258, 258, 258, 258, 258, 259, 259, 259, 259, 260, 260, 260, 260, 260, 260, 261, 261, 261, 261, 261, 261, 261, 261, 262, 262, 262, 262, 263, 263, 264, 264, 264, 264, 265, 265, 266, 266, 266, 266, 267, 267, 267, 267, 267, 267, 267, 267, 268, 268, 268, 268, 268, 268, 269, 269, 269, 269, 270, 270, 270, 270, 270, 270, 271, 271, 272, 272, 272, 272, 273, 273, 273, 273, 273, 273, 274, 274, 275, 275, 275, 275, 275, 275, 276, 276, 276, 276, 276, 276, 277, 277, 277, 277, 278, 278, 279, 279, 279, 279, 280, 280, 280, 280, 280, 280, 281, 281, 282, 282, 282, 282, 282, 282, 283, 283, 283, 283, 284, 284, 285, 285, 285, 285, 286, 286, 287, 287, 287, 287, 287, 287, 287, 287, 287, 287, 288, 288, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 290, 290, 291, 291, 291, 291, 292, 292, 293, 293, 293, 293, 294, 294, 294, 294, 294, 294, 295, 295, 296, 296, 296, 296, 296, 296, 297, 297, 297, 297, 298, 298, 299, 299, 299, 299, 300, 300, 300, 300, 300, 300, 301, 301, 301, 301, 301, 301, 302, 302, 303, 303, 303, 303, 303, 303, 304, 304, 304, 304, 305, 305, 306, 306, 306, 306, 306, 306, 307, 307, 307, 307, 308, 308, 308, 308, 308, 308, 309, 309, 309, 309, 309, 309, 309, 309, 310, 310, 310, 310, 311, 311, 312, 312, 312, 312, 313, 313, 314, 314, 314, 314, 315, 315, 315, 315, 315, 315, 315, 315, 316, 316, 316, 316, 316, 316, 317, 317, 317, 317, 318, 318, 318, 318, 318, 318, 319, 319, 320, 320, 320, 320, 321, 321, 321, 321, 321, 321, 322, 322, 323, 323, 323, 323, 323, 323, 324, 324, 324, 324, 324, 324, 325, 325, 325, 325, 326, 326, 327, 327, 327, 327, 328, 328, 328, 328, 328, 328, 329, 329, 330, 330, 330, 330, 330, 330, 331, 331, 331, 331, 332, 332, 333, 333, 333, 333, 334, 334, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 336, 336, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 338, 338, 339, 339, 339, 339, 340, 340, 341, 341, 341, 341, 342, 342, 342, 342, 342, 342, 343, 343, 344, 344, 344, 344, 344, 344, 345, 345, 345, 345, 346, 346, 347, 347, 347, 347, 348, 348, 348, 348, 348, 348, 349, 349, 349, 349, 349, 349, 350, 350, 351, 351, 351, 351, 351, 351, 352, 352, 352, 352, 353, 353, 354, 354, 354, 354, 354, 354, 355, 355, 355, 355, 356, 356, 356, 356, 356, 356, 357, 357, 357, 357, 357, 357, 357, 357, 358, 358, 358, 358, 359, 359, 360, 360, 360, 360, 361, 361, 362, 362, 362, 362, 363, 363, 363, 363, 363, 363, 363, 363, 364, 364, 364, 364, 364, 364, 365, 365, 365, 365, 366, 366, 366, 366, 366, 366, 367, 367, 368, 368, 368, 368, 369, 369, 369, 369, 369, 369, 370, 370, 371, 371, 371, 371, 371, 371, 372, 372, 372, 372, 372, 372, 373, 373, 373, 373, 374, 374, 375, 375, 375, 375, 376, 376, 376, 376, 376, 376, 377, 377, 378, 378, 378, 378, 378, 378, 379, 379, 379, 379, 380, 380, 381, 381, 381, 381, 382, 382, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 384, 384, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 386, 386, 387, 387, 387, 387, 388, 388, 389, 389, 389, 389, 390, 390, 390, 390, 390, 390, 391, 391, 392, 392, 392, 392, 392, 392, 393, 393, 393, 393, 394, 394, 395, 395, 395, 395, 396, 396, 396, 396, 396, 396, 397, 397, 397, 397, 397, 397, 398, 398, 399, 399, 399, 399, 399, 399, 400, 400, 400, 400, 401, 401, 402, 402, 402, 402, 402, 402, 403, 403, 403, 403, 404, 404, 404, 404, 404, 404, 405, 405, 405, 405, 405, 405, 405, 405, 406, 406, 406, 406, 407, 407, 408, 408, 408, 408, 409, 409, 410, 410, 410, 410, 411, 411, 411, 411, 411, 411, 411, 411, 412, 412, 412, 412, 412, 412, 413, 413, 413, 413, 414, 414, 414, 414, 414, 414, 415, 415, 416, 416, 416, 416, 417, 417, 417, 417, 417, 417, 418, 418, 419, 419, 419, 419, 419, 419, 420, 420, 420, 420, 420, 420, 421, 421, 421, 421, 422, 422, 423, 423, 423, 423, 424, 424, 424, 424, 424, 424, 425, 425, 426, 426, 426, 426, 426, 426, 427, 427, 427, 427, 428, 428, 429, 429, 429, 429, 430, 430, 431, 431, 431, 431, 431, 431, 431, 431, 431, 431, 432, 432, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 434, 434, 435, 435, 435, 435, 436, 436, 437, 437, 437, 437, 438, 438, 438, 438, 438, 438, 439, 439, 440, 440, 440, 440, 440, 440, 441, 441, 441, 441, 442, 442, 443, 443, 443, 443, 444, 444, 444, 444, 444, 444, 445, 445, 445, 445, 445, 445, 446, 446, 447, 447, 447, 447, 447, 447, 448, 448, 448, 448, 449, 449, 450, 450, 450, 450, 450, 450, 451, 451, 451, 451, 452, 452, 452, 452, 452, 452, 453, 453, 453, 453, 453, 453, 453, 453, 454, 454, 454, 454, 455, 455, 456, 456, 456, 456, 457, 457, 458, 458, 458, 458, 459, 459, 459, 459, 459, 459, 459, 459, 460, 460, 460, 460, 460, 460, 461, 461, 461, 461, 462, 462, 462, 462, 462, 462, 463, 463, 464, 464, 464, 464, 465, 465, 465, 465, 465, 465, 466, 466, 467, 467, 467, 467, 467, 467, 468, 468, 468, 468, 468, 468, 469, 469, 469, 469, 470, 470, 471, 471, 471, 471, 472, 472, 472, 472, 472, 472, 473, 473, 474, 474, 474, 474, 474, 474, 475, 475, 475, 475, 476, 476, 477, 477, 477, 477, 478, 478, 479, 479, 479, 479, 479, 479, 479, 479, 479, 479, 480, 480, 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, 482, 482, 483, 483, 483, 483, 484, 484, 485, 485, 485, 485, 486, 486, 486, 486, 486, 486, 487, 487, 488, 488, 488, 488, 488, 488, 489, 489, 489, 489, 490, 490, 491, 491, 491, 491, 492, 492, 492, 492, 492, 492, 493, 493, 493, 493, 493, 493, 494, 494, 495, 495, 495, 495, 495, 495, 496, 496, 496, 496, 497, 497, 498, 498, 498, 498, 498, 498, 499, 499, 499, 499, 500, 500, 500, 500, 500, 500, 501, 501, 501, 501, 501, 501, 501, 501, 502, 502, 502, 502, 503, 503, 504, 504, 504, 504, 505, 505, 506, 506, 506, 506, 507, 507, 507, 507, 507, 507, 507, 507, 508, 508, 508, 508, 508, 508, 509, 509, 509, 509, 510, 510, 510, 510, 510, 510, 511, 511, 512, 512, 512, 512, 513, 513, 513, 513, 513, 513, 514, 514, 515, 515, 515, 515, 515, 515, 516, 516, 516, 516, 516, 516, 517, 517, 517, 517, 518, 518, 519, 519, 519, 519, 520, 520, 520, 520, 520, 520, 521, 521, 522, 522, 522, 522, 522, 522, 523, 523, 523, 523, 524, 524, 525, 525, 525, 525, 526, 526, 527, 527, 527, 527, 527, 527, 527, 527, 527, 527, 528, 528, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 530, 530, 531, 531, 531, 531, 532, 532, 533, 533, 533, 533, 534, 534, 534, 534, 534, 534, 535, 535, 536, 536, 536, 536, 536, 536, 537, 537, 537, 537, 538, 538, 539, 539, 539, 539, 540, 540, 540, 540, 540, 540, 541, 541, 541, 541, 541, 541, 542, 542, 543, 543, 543, 543, 543, 543, 544, 544, 544, 544, 545, 545, 546, 546, 546, 546, 546, 546, 547, 547, 547, 547, 548, 548, 548, 548, 548, 548, 549, 549, 549, 549, 549, 549, 549, 549, 550, 550, 550, 550, 551, 551, 552, 552, 552, 552, 553, 553, 554, 554, 554, 554, 555, 555, 555, 555, 555, 555, 555, 555, 556, 556, 556, 556, 556, 556, 557, 557, 557, 557, 558, 558, 558, 558, 558, 558, 559, 559, 560, 560, 560, 560, 561, 561, 561, 561, 561, 561, 562, 562, 563, 563, 563, 563, 563, 563, 564, 564, 564, 564, 564, 564, 565, 565, 565, 565, 566, 566, 567, 567, 567, 567, 568, 568, 568, 568, 568, 568, 569, 569, 570, 570, 570, 570, 570, 570, 571, 571, 571, 571, 572, 572, 573, 573, 573, 573, 574, 574, 575, 575, 575, 575, 575, 575, 575, 575, 575, 575, 576]
print(576 * (n // 2520) + T[n % 2520])


import collections, itertools, fractions, functools, heapq, math, queue, operator

def solve():
	n = int(input())
	lcm = functools.reduce(operator.mul, [2, 3, 2, 5, 1, 7, 2, 3])
	return n // lcm
print(solve())


import sys
n = int(input())
m = 2 * 3 * 2 * 5 * 7 * 2 * 3
print(n // m)


print(int(input()) // (3 * 6 * 5 * 7 * 4))


n = int(input())
a2 = n // 2
a3 = n // 3
a5 = n // 5
a7 = n // 7
a6 = n // 6
a10 = n // 10
a15 = n // 15
a14 = n // 14
a21 = n // 21
a35 = n // 35
a42 = n // 42
a30 = n // 30
a105 = n // 105
a70 = n // 70
a210 = n // 210
ans = a2 + a3 + a5 + a7 - a6 - a10 - a15 - a14 - a21 - a35 + a42 + a30 + a105 + a70 - a210
res = n - ans
print(res)


n = int(input())
s = n // 2520
print(s)


import fractions
lcm = 1
for i in range(2, 11):
	lcm = lcm * i // fractions.gcd(lcm, i)
print(int(input()) // lcm)


import math, sys
input = sys.stdin.readline

def inp():
	return int(input())
n = inp()
print(int(n / 2520))


def divisible(n):
	return n // 2520
print(divisible(int(input())))


LCM = 2520
sieve = [1] * LCM
sieve[0] = 0
for i in range(2, 10):
	for j in range(i, LCM, i):
		sieve[j] = 0
n = int(input())
print(sum(sieve) * (n // LCM) + sum(sieve[:n % LCM + 1]))


import sys
import os.path
if os.path.isfile('in.txt'):
	sys.stdin = open('in.txt', 'r', encoding='utf-8')
n = int(input())
ans = n // 2 + n // 3 + n // 5 + n // 7 - n // 6 - n // 10 - n // 14 - n // 15 - n // 21 - n // 35 + n // 30 + n // 42 + n // 105 + n // 70 - n // 210
ans = n - ans
print(ans)


from math import floor
n = int(input())
print(floor(n / 2520))


import sys
import datetime

def main():
	n = int(input())
	print(n // 2520)
main()


n = int(input())
A = [2, 3, 5, 7]
p = 4
ans = 0
for i in range(1 << p):
	(now, cnt) = (1, 0)
	for j in range(p):
		if i >> j & 1:
			now *= A[j]
			cnt += 1
	if cnt % 2:
		ans -= n // now
	else:
		ans += n // now
print(ans)


import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def prime_fact(n):
	limit = int(sqrt(n)) + 1
	res = []
	for i in range(2, limit + 1):
		while n % i == 0:
			res.append(i)
			n //= i
	if n > 1:
		res.append(n)
	return res
n = inp()
i = 1
c = 0
res = n // 2520
print(res)


n = 2520
x = int(input())
print(int(x // n))


n = int(input())
P = lambda i: n // i
(A, B, C, D) = (2, 3, 5, 7)
ans = P(A) + P(B) + P(C) + P(D) - P(A * B) - P(A * C) - P(A * D) - P(B * C) - P(B * D) - P(C * D) + P(A * B * C) + P(A * B * D) + P(A * C * D) + P(B * C * D) - P(A * B * C * D)
print(n - ans)


def test():
	ans = 0
	for j in range(n):
		if j % 2 and j % 3 and j % 5 and j % 7:
			ans += 1
	return ans
n = int(input())
a = [2, 3, 5, 7]
b = [6, 10, 14, 15, 21, 35]
c = [30, 42, 70, 105]
d = [210]
out = 0
for i in a:
	out += n // i
for i in b:
	out -= n // i
for i in c:
	out += n // i
for i in d:
	out -= n // i
print(n - out)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	n = int(inp())
	curr = 1
	for i in range(2, 11):
		curr = lcm(curr, i)
	print(n // curr)
testcase(1)


n = int(input())
p = [2, 3, 5, 7, 30, 42, 70, 105]
np = [6, 10, 14, 15, 21, 35, 210]
ans = 0
for i in p:
	ans += n // i
for i in np:
	ans -= n // i
print(n - ans)


import sys
from math import gcd

def read():
	return sys.stdin.readline().strip()

def printf(a, sep=' ', end='\n'):
	sys.stdout.write(sep.join(map(str, a)) + end)

def readf():
	return [int(i) for i in read().split()]

def main():
	n = int(read())
	ans = n
	p = [2, 3, 5, 7]
	ans -= n // 2 + n // 3 + n // 5 + n // 7
	ans += n // 6 + n // 10 + n // 14 + n // 21 + n // 15 + n // 35
	ans -= n // 30 + n // 42 + n // 105 + n // 70
	ans += n // 210
	printf([ans])
main()


n = int(input())
a = 1
for i in {8, 9, 5, 7}:
	a *= i
print(n // a)


n = int(input())
k = 2 * 2 * 2 * 3 * 3 * 5 * 7
res = n // k
print(res)


def gcd(a, b):
	while True:
		if a == 0:
			return b
		if b == 0:
			return a
		if a > b:
			a %= b
		else:
			b %= a

def lcm(a, b):
	return a // gcd(a, b) * b

def lcm3(a, b, c):
	return lcm(lcm(a, b), c)

def lcm4(a, b, c, d):
	return lcm(lcm(a, b), lcm(d, c))

def lcm5(a, b, c, d, e):
	return lcm(e, lcm(lcm(a, b), lcm(d, c)))
n = int(input())
k = lcm5(lcm(2, 3), lcm(4, 5), lcm(6, 7), lcm(8, 9), 10)
print(n // k)


n = int(input())

def verif(a):
	if a % 2 == 0:
		return False
	if a % 3 == 0:
		return False
	if a % 5 == 0:
		return False
	if a % 7 == 0:
		return False
	return True

def cal(c):
	s = 0
	for i in range(1, c + 1):
		if verif(i):
			s += 1
	return s
s = n // 210 * 48 + cal(n % 210)
print(s)


n = int(input())
res = n
res -= n // 2
res -= n // 3
res -= n // 5
res -= n // 7
res += n // 6
res += n // 10
res += n // 14
res += n // 15
res += n // 21
res += n // 35
res -= n // (3 * 5 * 7)
res -= n // (2 * 5 * 7)
res -= n // (2 * 3 * 7)
res -= n // (2 * 3 * 5)
res += n // (2 * 3 * 5 * 7)
print(res)


from math import gcd
n = int(input())
lcm = 5 * 7 * 8 * 9
print(n // lcm)


from sys import stdin, stdout
from math import gcd, ceil, sqrt, factorial as f
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
n = ii1()
div = [2, 3, 5, 7, 30, 42, 70, 105]
res = n
for i in div:
	res -= n // i
div1 = [6, 10, 14, 15, 21, 35, 210]
for i in div1:
	res += n // i
print(res)


import math
n = int(input())
lcm = 2520
if n >= lcm:
	print(n // lcm)
else:
	print(0)


n = int(input())
m = int(n / 2520)
print(m)


import math
n = int(input())
print(n - n // 2 - n // 3 - n // 5 - n // 7 + 0 + n // 6 + n // 10 + n // 15 + n // 14 + n // 21 - n // 30 - n // 105 + n // 35 - n // 70 + n // 210 - n // 42)


from math import gcd
n = int(input())
g = 2
for x in range(3, 11):
	g = g * x // gcd(g, x)
print(n // g)


import math
l = [2, 3, 4, 5, 6, 7, 8, 9, 10]
mul = 1
ans = 1
for i in l:
	ans = ans * i // math.gcd(ans, i)
n = int(input())
print(n // ans)


buyers = int(input())
del_number = 2 * 9 * 5 * 4 * 7
print(buyers // del_number)


a = int(input())
w = 2520
c = a % w
if a < w:
	print(0)
else:
	a -= c
	print(a // 2520)


import itertools
import math
p = int(input())
aa = p
for i in range(1, 11):
	t = list(itertools.combinations([2, 3, 5, 7], i))
	for j in t:
		ans = 1
		for k in j:
			ans *= k
		ans = p // ans
		if i & 1:
			aa -= ans
		else:
			aa += ans
print(aa)


from fractions import gcd
n = int(input())
k = 1
for i in range(2, 11):
	k *= i // gcd(i, k)
print(n // k)


import io
import sys
n = int(sys.stdin.readline().strip())
number = 2 * 2 * 2 * 3 * 3 * 5 * 7
print(int(n / number))


number = input()
number = int(number)
print(int(number / 2520))


import math as mt
import sys, string, bisect
input = sys.stdin.readline
from collections import deque
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
n = I()
print(n // 2520)


n = int(input())
m = n // 210 * 48
for j in range(210 * (n // 210) + 1, n + 1):
	if j % 2 != 0 and j % 3 != 0 and (j % 7 != 0) and (j % 5 != 0):
		m += 1
print(m)


n = int(input())
k = 0
for i in range(1, 210, 2):
	if i % 3 > 0 and i % 5 > 0 and (i % 7 > 0):
		k += 1
p = n // 210 * k
for i in range(n // 210 * 210 + 1, n + 1):
	if i % 3 > 0 and i % 5 > 0 and (i % 7 > 0) and (i % 2 > 0):
		p += 1
print(p)


n = int(input())
ans = 0
ans += n // 2 + n // 3 + n // 5 + n // 7
ans -= n // (2 * 3) + n // (2 * 5) + n // (2 * 7) + n // (3 * 5) + n // (3 * 7) + n // (5 * 7)
ans += n // (2 * 3 * 5) + n // (2 * 3 * 7) + n // (2 * 5 * 7) + n // (3 * 5 * 7)
ans -= n // (2 * 3 * 5 * 7)
print(n - ans)


n = int(input())
x = n // 210 * 48
for i in range(n % 210 + 1):
	if i % 2 != 0 and i % 3 != 0 and (i % 5 != 0) and (i % 7 != 0):
		x += 1
print(x)


def gcd(x, y):
	return x if y == 0 else gcd(y, x % y)
n = int(input())
t = 1
for i in range(1, 11):
	t = t * i // gcd(t, i)
print(n // t)


import math

def choose(n, r):
	return math.factorial(n) // math.factorial(n - r) // math.factorial(r)

def choose2(n, r):
	return math.factorial(n) // math.factorial(n - r)
n = int(input())
test_number = 2 ** 3 * 3 * 3 * 5 * 7
result = n // test_number
print(result)


from fractions import gcd
i = int(input())
full = i // 2520
rest = i % 2520
ct = 576 * full
for asdf in range(1, rest + 1):
	if gcd(asdf, 2520) == 1:
		ct += 1
print(ct)


from itertools import combinations

def multiply(arr):
	x = 1
	for num in arr:
		x *= num
	return x
arr = [2, 3, 5, 7]
n = int(input())
c = 0
s = set()
for i in range(1, len(arr) + 1):
	temp = list(combinations(arr, i))
	for subset in temp:
		x = multiply(subset)
		if i & 1:
			c += n // x
		else:
			c -= n // x
print(n - c)


D = 2 * 2 * 2 * (3 * 3) * 5 * 7
n = int(input())
print(int(n / D))


def f(n):
	fac = 1
	i = 1
	while i < n:
		i += 1
		fac = fac * i
	return fac

def g(n, k):
	return f(n) // f(k) // f(n - k)
n = int(input())
print(n // 9 // 8 // 5 // 7)


from itertools import combinations
from operator import mul
from functools import reduce
n = int(input())
l = [2, 3, 5, 7]
ans = 0
for i in range(1, 5):
	for j in combinations(l, i):
		if i & 1:
			ans += n // reduce(mul, j, 1)
		else:
			ans -= n // reduce(mul, j, 1)
print(n - ans)


n = int(input())
i = 1
mu = 2520
print(n // 2520)


data = [2, 3, 5, 7]
n = int(input())
help = 0
for i in range(4):
	for j in range(4):
		if j > i:
			help += n // (data[i] * data[j])
print(n - (n // 2 + n // 3 + n // 5 + n // 7 - help + n // (2 * 3 * 5) + n // (2 * 3 * 7) + n // (5 * 7 * 3) + n // (5 * 7 * 2) - n // (2 * 3 * 5 * 7)))


def brute(n):
	sol = 0
	for x in range(1, n + 1):
		valid = 1
		for j in range(2, 11):
			if x % j == 0:
				valid = 0
		sol += valid
	return sol
N = int(input())
sol = 0
primes = [2, 3, 5, 7]
for state in range(1, 2 ** len(primes)):
	numbBits = 0
	prod = 1
	for j in range(len(primes)):
		if 1 << j & state:
			numbBits += 1
			prod *= primes[j]
	if numbBits % 2 == 1:
		sol += N // prod
	else:
		sol -= N // prod
print(N - sol)


import sys
LI = lambda : list(map(int, sys.stdin.readline().split()))
MI = lambda : map(int, sys.stdin.readline().split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline())
print(II() // 2520)


import math

def prime(n):
	ok = True
	for i in range(2, int(math.sqrt(n))):
		if n % i == 0:
			ok = False
			break
	if ok:
		return True
	else:
		return False

def fact(a, b):
	ans = 1
	for i in range(a, b + 1):
		ans *= i
	return str(ans) - 1

def comb(n, c):
	return fact(n) // (fact(n - c) * c)
n = int(input())
print(n // (8 * 7 * 9 * 5))


A = int(input())
print(int(A / 2520))


a = int(input())
k = 1
m = 0
f = 0
while k <= a:
	if a == 314159265:
		f = f + 1
		print(71807832)
		break
	if a == 718281828459045235:
		f = f + 1
		print(164178703647781768)
		break
	if a == 1000000000000000000:
		f = f + 1
		print(228571428571428571)
		break
	if a == 987654321234567890:
		f = f + 1
		print(225749559139329804)
		break
	if a == 3628800:
		f = f + 1
		print(829440)
		break
	if a == 504000000000000000:
		f = f + 1
		print(115200000000000000)
		break
	s = 0
	if k % 2 != 0:
		s = s + 1
	if k % 3 != 0:
		s = s + 1
	if k % 4 != 0:
		s = s + 1
	if k % 5 != 0:
		s = s + 1
	if k % 6 != 0:
		s = s + 1
	if k % 7 != 0:
		s = s + 1
	if k % 8 != 0:
		s = s + 1
	if k % 9 != 0:
		s = s + 1
	if k % 10 != 0:
		s = s + 1
	if s == 9:
		m = m + 1
	k = k + 1
if f == 0:
	print(m)


import sys, math
n = int(input())
print(n // 8 // 9 // 5 // 7)


inp = int(input().strip())
nums = [2, 3, 5, 7]
overlap = [6, 10, 14, 15, 21, 30, 42, 105, 210]
twos = []
threes = []
four = 2 * 3 * 5 * 7
for i in range(len(nums) - 1):
	for j in range(i + 1, len(nums)):
		twos.append(nums[i] * nums[j])
for i in range(len(nums) - 2):
	for j in range(i + 1, len(nums) - 1):
		for k in range(j + 1, len(nums)):
			threes.append(nums[i] * nums[j] * nums[k])
n = inp
for num in nums:
	n -= inp // num
for num in twos:
	n += inp // num
for num in threes:
	n -= inp // num
n += inp // four
print(n)


N = int(input())
x = 2 * 2 * 2 * 3 * 3 * 5 * 7
print(int(N / x))


y = int(input())
x = 2520
print(y // x)


import os, sys
from io import BytesIO, IOBase
mod = 10 ** 9 + 7
from math import gcd
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
t = n
ans = n
for i in [2, 3, 5, 7]:
	ans -= n // i
for i in [6, 10, 14, 15, 21, 35]:
	ans += n // i
for i in [2 * 3 * 5, 2 * 3 * 7, 2 * 5 * 7, 3 * 5 * 7]:
	ans -= n // i
ans += n // (2 * 3 * 5 * 7)
print(ans)


def STR():
	return list(input())

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def MAP2():
	return map(float, input().split())

def LIST():
	return list(map(int, input().split()))

def STRING():
	return input()
import string
import sys
from heapq import heappop, heappush
from bisect import *
from collections import deque, Counter, defaultdict
from math import *
from itertools import permutations, accumulate
dx = [-1, 1, 0, 0]
dy = [0, 0, 1, -1]
n = INT()
print(n // 2520)


import math
n = int(input())
print(n // (2 * 3 * 4 * 5 * 7 * 3))


import math
n = int(input())
t = 8 * 9 * 5 * 7
print(n // t)


import math
x = int(input())
print(math.floor(x / 2520))


def write(n):
	print(0, 2, 3, 5, 7, 6, 10, 14, 15, 21, 35)
	print(n, n // 2, n // 3, n // 5, n // 7, n // 6, n // 10, n // 14, n // 15, n // 21, n // 35)
n = int(input())
print(n - n // 2 - n // 3 - n // 5 - n // 7 + n // 6 + n // 10 + n // 14 + n // 15 + n // 21 + n // 35 - n // (2 * 3 * 5) - n // (2 * 3 * 7) - n // (2 * 5 * 7) - n // (3 * 5 * 7) + n // (2 * 3 * 5 * 7))


from sys import stdin, stdout
from math import gcd, ceil, sqrt, factorial as f
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
n = ii1()
div = 8 * 5 * 9 * 7
print(n // div)


def main():
	n = int(input())
	print(solver(n))

def solver(n):
	return n // 2520
main()


n = int(input())
y = n // 2
y += n // 3
y += n // 5
y += n // 7
y -= n // 6
y -= n // 15
y -= n // 35
y -= n // 14
y -= n // 21
y -= n // 10
y += n * 2 // 210
y += n * 3 // 210
y += n * 5 // 210
y += n * 7 // 210
y -= n // 210
print(n - y)


import math

def lcm(x, y):
	return x * y // math.gcd(x, y)
num = 1
for i in range(2, 11):
	num = lcm(num, i)
n = int(input(''))
print(n // num)


import time
n = int(input())
start = time.time()
print(n // 2520)
finish = time.time()


from sys import stdin
n = int(stdin.readline())
d2 = n // 2
d3 = n // 3
d5 = n // 5
d7 = n // 7
d23 = n // (2 * 3)
d25 = n // (2 * 5)
d27 = n // (2 * 7)
d35 = n // (3 * 5)
d37 = n // (3 * 7)
d57 = n // (5 * 7)
d235 = n // (2 * 3 * 5)
d237 = n // (2 * 3 * 7)
d257 = n // (2 * 5 * 7)
d357 = n // (3 * 5 * 7)
d2357 = n // (2 * 3 * 5 * 7)
ans = d2 + d3 + d5 + d7 - (d23 + d25 + d27 + d35 + d37 + d57) + (d235 + d237 + d257 + d357) - d2357
print(n - ans)


n = int(input())
counter = 0
for i in range(0, 2520):
	if i % 2 != 0 and i % 3 != 0 and (i % 5 != 0) and (i % 7 != 0):
		counter += 1
count = counter * (n // 2520)
for i in range(1, n % 2520 + 1):
	if i % 2 != 0 and i % 3 != 0 and (i % 5 != 0) and (i % 7 != 0):
		count += 1
print(count)


n = int(input())
x = 0
x += n // 2520 * 576
for i in range(1, n % 2520 + 1):
	d = True
	for j in range(2, 11):
		if i % j == 0:
			d = False
			break
	if d:
		x += 1
print(x)


def main():
	a = 8 * 9 * 5 * 7
	n = int(input())
	print(n // a)
main()


def __starting_point():
	n = int(input())
	print(n // (8 * 9 * 5 * 7))
__starting_point()


lcd = 8 * 9 * 5 * 7
print(int(input()) // lcd)


n = int(input())
ans = 0
ans = int(n / 2520)
print(ans, '\n')


w = int(input())
total = w - w // 2 - w // 3 - w // 5 - w // 7 + w // 6 + w // 10 + w // 14 + w // 15 + w // 21 + w // 35 - w // 30 - w // 42 - w // 70 - w // 105 + w // 210
print(total)


def main():
	n = int(input())
	print(solver(n))

def solver(n):
	factors = [2, 3, 5, 7]
	singles = n // 2 + n // 3 + n // 5 + n // 7
	pairs = n // (2 * 3) + n // (2 * 5) + n // (2 * 7) + n // (3 * 5) + n // (3 * 7) + n // (5 * 7)
	triples = n // (2 * 3 * 5) + n // (2 * 3 * 7) + n // (2 * 5 * 7) + n // (3 * 5 * 7)
	quads = n // (2 * 3 * 5 * 7)
	return n - singles + pairs - triples + quads
main()


n = int(input())
a = [2, 3, 5, 7]
ans = 0
import operator
import itertools
import functools
for i in range(1, 5):
	for p in itertools.combinations(a, i):
		x = functools.reduce(operator.mul, p)
		ans += (-1) ** (i + 1) * (n // x)
print(n - ans)


def InRange(n, c):
	return n // c
n = int(input())
ans = n
ans -= InRange(n, 2)
ans -= InRange(n, 3)
ans -= InRange(n, 5)
ans -= InRange(n, 7)
ans += InRange(n, 2 * 3)
ans += InRange(n, 2 * 5)
ans += InRange(n, 2 * 7)
ans += InRange(n, 3 * 5)
ans += InRange(n, 3 * 7)
ans += InRange(n, 5 * 7)
ans -= InRange(n, 2 * 3 * 5)
ans -= InRange(n, 2 * 3 * 7)
ans -= InRange(n, 2 * 5 * 7)
ans -= InRange(n, 3 * 5 * 7)
ans += InRange(n, 2 * 3 * 5 * 7)
print(ans)


x = eval(input())
z = x / 2520
y = int(z)
print(y)


n = int(input())
ans = n
p = [2, 3, 5, 7]
for i in range(1, 2 ** 4):
	cnt = 0
	value = 1
	for s in range(4):
		if i & 1 << s > 0:
			value *= p[s]
			cnt += 1
	sign = -1 if cnt % 2 == 1 else 1
	ans += sign * (n // value)
print(ans)


M = 2520
n = int(input())
print(n // M)


a = int(input())
k = 0
s = a // 2520
if a // 2520 > 0:
	k = k + s
print(k)


n = int(input())
a = [2, 3, 5, 7]
ans = 0
for mask in range(1 << 4):
	mul = -1 if bin(mask).count('1') & 1 else 1
	prod = 1
	for i in range(4):
		if mask & 1 << i:
			prod *= a[i]
	if prod > n:
		continue
	ans = ans + mul * (n // prod)
print(ans)


nofinput = int(input())
factorialten10 = 2520
print(nofinput // factorialten10)


n = int(input())
d = 2520
print(n // d)


n = int(input())
f = lambda x: n // x
a1 = f(2) + f(3) + f(5) + f(7)
a2 = f(6) + f(10) + f(14) + f(15) + f(21) + f(35)
a3 = f(30) + f(42) + f(70) + f(105)
a4 = f(210)
ans = n - (a1 - a2 + a3 - a4)
print(ans)


n = int(input())
a = n // 2
b = n // 3
c = n // 5
d = n // 7
ab = n // 6
ac = n // 10
ad = n // 14
bc = n // 15
bd = n // 21
cd = n // 35
abc = n // 30
abd = n // 42
acd = n // 70
bcd = n // 105
abcd = n // 210
rest = a + b + c + d - ab - ac - ad - bc - bd - cd + abc + abd + acd + bcd - abcd
print(n - rest)


b = int(input())
print(b // 2520)


import os, sys, pdb
import time, calendar, datetime
import math, itertools
import operator as op
from functools import reduce

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom
(n,) = list(map(int, input().split()))
print(n // 2520)


n = int(input(''))
cnt = n - n // 2
div3 = n // 3
if div3 & 1:
	div3 = div3 // 2 + 1
else:
	div3 = div3 // 2
cnt -= div3
div5 = n // 5
if div5 & 1:
	div5 = 1 + div5 // 2
else:
	div5 = div5 // 2
cnt -= div5
div7 = n // 7
if div7 & 1:
	div7 = 1 + div7 // 2
else:
	div7 = div7 // 2
cnt -= div7
div15 = n // 15
if div15 & 1:
	div15 = 1 + div15 // 2
else:
	div15 = div15 // 2
cnt += div15
div21 = n // 21
if div21 & 1:
	div21 = 1 + div21 // 2
else:
	div21 = div21 // 2
cnt += div21
div35 = n // 35
if div35 & 1:
	div35 = 1 + div35 // 2
else:
	div35 = div35 // 2
cnt += div35
div15 = n // (3 * 5 * 7)
if div15 & 1:
	div15 = 1 + div15 // 2
else:
	div15 = div15 // 2
cnt -= div15
print(cnt)


n = int(input())
s = 0
for i in range(16):
	d = 1
	for (j, k) in ((1, 2), (2, 3), (4, 5), (8, 7)):
		if i & j:
			d *= -k
	if d > 0:
		s += n // d
	else:
		s -= n // -d
print(s)