IT City company developing computer games decided to upgrade its way to reward its employees. Now it looks the following way. 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 not divisible by any number 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 not divisible by any number from 2 to 10.


-----Examples-----
Input
12

Output
2

Difficulty: interview

Starter code:

Solutions:
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)


x = int(input())
#x, y = map(int, input().split())

y = x//210*48

for i in range(1, x%210 + 1):
	
	if i%2 and i%3 and i%5 and i%7:
		y+=1
print(y)



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)

def __starting_point():

    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)
__starting_point()

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)

def __starting_point():
    main()
__starting_point()

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)


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


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))

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 // 105 - n // 70 - n // 42 + n // 210)

n = int(input())
print (n // 1 - 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)

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))

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 = int(input())
ans = 0
ans = (n - n // 2 - n // 3 - n // 5 - n // 7 + n // (2 * 3) + n // (2 * 5) + n // (2 * 7) + n // (3 * 5) + n // (3 * 7) + n // (5 * 7) - n // (2 * 3 * 5) - n // (2 * 3 * 7) - n // (2 * 5 * 7) - n // (3 * 5 * 7) + n // (2 * 3 * 5 * 7))
print(ans)


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)


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=[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)


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))


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))


n = int(input())
res = 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 - res)


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)
#print(brute(N))


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)

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)

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])

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)))

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