peterverebics/CodeNet_Python_118 huggingface dataset:
def make_divisors(n):
    a,b =[],[]
    i = 1
    while i*i<=n:
        if n%i == 0:
            a.append(i)
            if i != n//i:
                b.append(n//i)
        i+= 1
    return a+b[::-1]

n = int(input())
c = len(make_divisors(n))
if n % 2 == 1 and (c== 8 or c == 16):
    print(1)
else:
    print(0)
n = int(input())

odd_prime = [3,5,7,11,13]
ans = 0
for i in range(3):
    for j in range(i+1,4):
        for h in range (j+1,5):
            if odd_prime[i] * odd_prime[j] * odd_prime[h] <= n:
                ans += 1
print(ans)
n = int(input())
ans = 1
for i in range(1, n + 1, 2):
    cnt = 0
    for j in range(1, i + 1):
        if i % j == 0:
            cnt  += 1
    if cnt == 8:
        ans += 1
print(ans)
n = int(input())
a = n//2
ans = 0
for j in range(1,n+1):
    count = 1
    for i in range(1,a+1):
        if n % i == 0:
            count += 1
        if count >= 8 and j % 2 == 1:
            ans +=1
print(ans)
if int(input())>=105:
  print(1)
else:
  print(0)
n=int(input())
count=0
for i in range(1,n+1):
    if n%i==0:
        count+=1
if count==8:
    print("1")
else:
    print("0")
def make_divisors(n):
    a,b =[],[]
    i = 1
    while i*i<=n:
        if n%i == 0:
            a.append(i)
            if i != n//i:
                b.append(n//i)
        i+= 1
    return a+b[::-1]

n = int(input())
c = len(make_divisors(n))
if n % 2 == 1 and c== 8 and c == 16 :
    print(1)
else:
    print(0)
def I(): return int(input())
n = I()
ans = 0
if n>=105:
    for i in range(105,n+1):
        cnt=0
        for j in range(1,int(n**0.5)+1):
            if i % j ==0:
                cnt+=2
        if cnt==8:ans+=1
print(ans)
N = int(input())
if (1 <= N < 105):
    print(0)
if (105 <= N < 135):
    print(1)
if (135 <= N < 155):
    print(2)
if (155 <= N < 189):
    print(3)
if (189 <= N < 195):
    print(4)
if (195<= N <= 200):
    print(5)
N=int(input())
def prime(n):
  cnt=0
  for i in range(2,n):
    if n%2==0:
      cnt+=1
    
  return cnt

ans=0
for i in range(1,N+1):
  if i%2==1 and prime(i)==8:
    ans+=1
print(ans)
N=int(input())
if N<=105:
    print(1)
else:
    ans=0
    for n in range(106,N+1):
        K=n//2
        y=0
        for k in range(2,K):
            if n%k==0:
                y+=1
        if y==6:
            ans+=1
    print(ans)
def divisor(m):
    cnt = 2
    for i in range(3, n, 2):
        if m % i == 0:
            cnt += 1
    return cnt

n = int(input())
if n < 105:
    print(0)
elif n == 105:
    print(1)
else:
    res = 1
    for i in range(107, n+1, 2):
        if divisor(i) == 8:
            res += 1
    print(res)
# B - 105

def yakusu_rekkyo(n):
    yakusu = set()
    for i in range(1, int(pow(n, 0.5)+1)):
        if n%i == 0:
            yakusu.add(i)
            if i!=n//i:
                yakusu.add(n//i)
    return yakusu

N = int(input())
ans = 0
for i in range(1, N+1, 2):
    Y = yakusu_rekkyo(N)
    if len(Y) == 8:
        ans += 1
        
print(ans)
N = int(input())
if N < 105:
    print(0)
else:
    ans = 1
    for a in range(107, N+1, 2):
        tmp = 1
        for b in range(2, a//2):
            if a % b == 0:
                tmp += 1
        if tmp == 8:
            ans += 1
    print(ans)
number = int(input())

num_eight_divisors = 0

for i in range(9, number + 1, 2):
    num_divisors = 2

    for j in range(2, i // 2):
        if i % j == 0:
            num_divisors = num_divisors + 2

        if num_divisors > 8:
            break

    if num_divisors == 8:
        num_eight_divisors = num_eight_divisors + 1

print(num_eight_divisors)
N=int(input())
ans=0
for i in range(1,N+1,2):
  cnt=2
  for j in range(3,int(i**0.5)+1,2):
    if i%j==0:
      print(i,j)
      cnt+=2
  if cnt==8:
    ans+=1
print(ans)
N = int(input())
cnt=0
y=[]

for i in range(1,N+1,2):
    for j in range(1,i+1):
        if i%j == 0:
            y.append(j)
            new_y=set(y)
            continue
    if len(new_y)==8:
        cnt += 1
        new_y.clear()
print(cnt)
n= int(input())
ans=0
for i in range(1,n+1,2):
    cnt=0
    for j in range(1,i+1):
        if n%j==0:
            cnt+=1
    if cnt==8:
        ans+=1
print(ans)
N=int(input())
u,v,w=0,0,0
count=0
ans=0
if N<105:
  print(ans)
  exit(0)
for i in range(104,N):
  for p in range(5):
      u=pow(3,p)
      for q in range(4):
          v=pow(5,q)
          for r in range(3):
              w=pow(7,r)
              if i%(u*v*w)==0:
                  count+=1
  if count==8:
    ans+=1
  count=0
print(ans)
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = int(input())
counter = 0
for i in range(1,N+1,1):
    if(len(make_divisors(i)) == 8):
        counter+=1
print(counter)
n=int(input())
count=0
ans=0
for j in range(1,n+1,2):
  count=0
  for i in range(1,int(j**0.5)):
    if j%i==0:
      count+=2
  if count==8:
    ans+=1
print(ans)
n=int(input())
ans=0
ans_y=0
for i in range(1,n+1):
    if i%2==1:
        for j in range(1,n+1):
            if i%j==0:
                ans_y+=1
        if ans_y==8:
            ans +=1
print(ans)
n = int(input())
ans = []
for i in range(n):
  temp = []
  for j in range(1, i + 1, 2):
    if i % j == 0:
      temp.append(j)
  if len(temp) == 8:
    ans.append(i)
    
print(len(ans))
N = int(input())
if N >= 195:
  print(3)
elif N >= 165:
  print(2)
elif N >= 105:
  print(1)
else:
  print(0)
n=input("n=")

s=0
yakusu=0



for i in range(1,int(n)+1):
    s=0
    if i%2!=0:
        for k in range(1,i):
            if i%k==0:
                s+=1    
    if s==8:
        yakusu+=1         

print(yakusu)
def abc106b_105():
    n = int(input())
    if n < 105:
        print(0)
        return
    cnt = 1
    for i in range(106, n + 1):
        yaku_cnt = 0
        for j in range(1, i + 1):
            if i % j == 0:
                yaku_cnt += 1
        if yaku_cnt == 8:
            cnt += 1

    print(cnt)
abc106b_105()
n = int(input())
if n < 105:
    print(0)
elif n == 105:
    print(1)
def hantei8(n):
    root_n = int(n**0.5)
    
    if root_n**2 == n:
        return False
    
    total = 0
    for i in range(1,root_n):
        if n % i == 0:
            total += 2
            
    if total == 8:
        return True
    else:
        return False

n = int(input())

total = 0
for i in range(1,n+1,2):
    if hantei8(i):
        total += 1

print(total)
n = int(input())
cnt = 0
l = []
for i in range(1, n+1):
    if i % 2 == 0:
        exit()
    else: 
        if n % i == 0:
            l.append(i)
            if len(l) == 8:
                cnt += 1
print(cnt)
n = int(input())
l = []
for j in range(1,n+1):
    if j%2 != 0:
        l.append(j)
a = 0
b = 0
for i in l:
    if n%i == 0:
        a += 1
else:
    if a == 8:
        b += 1
print(b)
N = int(input())
cnt = 0
ans = 0
if N < 105:
  print(0)
elif N == 105:
  print(1)
else:
  for i in range(106,N+1):
    if i%2 == 1:
      for j in range(1,i+1):
        if i%j == 0:
          cnt += 1
      if cnt == 8:
        ans += 1
  print(ans)
N=int(input())
ans=0
tmp=0
for j in range(1,200,2):
    for k in range(1,N+1):
        if k%j==0:
            tmp+=1
    if tmp==8:
        ans+=1
    tmp=0
print(ans)
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()

cnt = 0
ans = 0
for j in range(1,n+1,2):
	for i in range(j,n+1):
		if j%i == 0:
			cnt += 1
	if cnt == 8:
		ans += 1
print(ans)
N=int(input())
if N < 105:
  print("0")
elif N == 105:
  print("1")
else:
  ans = 0
  for i in range(105,N+1,2):
    nn = i
    c = 0
    s = 2
    while s*s<=i:
      if nn%s==0:
        c += 1
        nn //= s
        while nn%s==0:
          nn //= s
      s+=1
    if nn!=1 and nn!=s:
      c += 1
    if c == 3:
      ans += 1
  print(ans)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
ans=0
N=int(input())
if N<105:
    print(0)
    exit(0)
for i in range(104,N):
    if len(make_divisors(i))==8:
        ans+=1
print(ans)
def solve(N):
    allcount=0
    if N<105:
        return allcount
    for i in range(105,N+1):
        count=0
        for j in range(1,i+1):
            if i%j==0:
                count += 1
        if count==8:
            allcount += 1
    return allcount


N=int(input())
print(solve(N))
N = int(input())
c = 0
for  i in range(1,N+1):
  li = []
  if i < 10:
    continue
  else:
    k = i
    for j in range(2,int(i**(0.5)+1)):
      while k % j == 0:
        k = k/j
        li.append(j)
    if len(li) == 8:
      c += 1
print(c)
n = int(input())

if n < 105:
    print(0)
elif n >= 105 and n < 165:
    print(1)
elif n >= 165 and n < 195:
    print(2)
elif n >= 195:
    print(3)
S=int(input())
count=0
 
for i in range(1,S+1):
  a=0
  for j in range(1,i+1):
    if j % i ==0:
      a+=1
  if a==8:
    count+=1
print(count)
def yaku(n):
    x=0
    for i in range(1,n+1):
        if n%i==0:
            x+=1
    return x//2

n=int(input())
if n<105:
    print(0)
    
elif n%2!=0:
    x=1
    if yaku(n)==8:
        x+=1
    print(x)
N = int(input())
if N < 105:
    print(0)
elif N < 135:
    print(1)
else:
    print(2)
n=int(input())
cnt=0
for i in range(1,n+1):
    if n%i == 0:
        cnt += 1
print(cnt)
in_num = int(input())
check_num = 1
ans_counter = 0

while check_num <= in_num:
	i = 1
	div_counter = 0
	while i <= check_num /2:
		if check_num % i == 0:
			div_counter += 1
		i += 2
	if div_counter == 8:
		ans_counter += 1
	check_num += 2

print(ans_counter)
n = int(input())

if n== 105:
    print('1')
else:
    print('0')
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
ans=0
N=int(input())
if N<105:
    print(0)
    exit(0)
for i in range(105,N)[::2]:
    if len(make_divisors(i))==8:
        ans+=1
print(ans)
n = int(input())

a = [3,5,7,11]
ax = 3*5*7*11
b = []
for i in range(4):
    b.append(ax//a[i])
for j in range(3):
    b.append(a[j]**3 * a[j+1])

ans = 0
for i in b:
    if n >= i:
        ans += 1
print(ans)
def check(n):
  d=[]
  for i in range(1,int(n**0.5)+1,2):
    if n%i==0:
      d.append(i)
      if i!=n//i:
        d.append(n//i)
  if len(d)==8: return True
  else: return False

print(int(check(int(input()))))
import sys

n = int(sys.stdin.readline().rstrip("\n"))
count = 0
for num in range(27, n+1, 2):
    divisor = 0
    for p in range(1, num, 2):
        if num % p == 0:
            q = int((num - num % p)/ p)
            if q > p:
                divisor += 1
            else:
                break
    if divisor == 8:
        count += 1
print(count)
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np

def main():
	n=int(input())
	ans=0
	if n>=105:
		ans+=1
	if n>=135:
		ans+=1
	if n>=165:
		ans+=1
	if n>189:
		ans+=1
	
	print(ans)
	
	
if __name__ == "__main__":
	main()
import sys
def input(): return sys.stdin.readline().strip()

def main():
    n = int(input())
    ans = 0
    for m in range(1, n + 1):
        if m % 2 == 0: continue
        factor = 0
        for j in range(1, int(m ** 0.5)):
            if m % j == 0: factor += 2
        if int(round(m ** 0.5)) ** 2 == m: factor += 1
        if factor == 8: ans += 1
        #print("factor[{}]={}".format(m, factor))
    print(ans)


if __name__ == "__main__":
    main()
S=int(input())
count=0

for i in range(1,S):
  a=0
  for j in range(1,i):
    if j % i ==0:
      a+=1
  if a==8:
    count+=1
print(count)
def solve():
    ans = 0
    n=int(input())
    for i in range(1,n+1):
        div_list = []
        for j in range(1,int(i**0.5)+1):
            if i%j!=0:
                continue
            if i//j==j:
                div_list.append(j)
            else:
                div_list.append(i//j)
                div_list.append(j)
    print(ans)

if __name__ == '__main__':
    solve()
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()

if N < 105:
    print(1)
    exit()

ans = 0
for i in range(105,N+1):
    cnt = 0
    for q in range(1,int(N**0.5)+1):
        if i % q == 0:
            cnt += 2
    if cnt == 8:
        ans += 1
print(ans)
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()

ans=0
for k in range(5,n+1):
    c=0
    for i in range(1,int(k**0.5),2):
        if k%i==0:
            c+=2
    if i**2==k:
        c+=1
    if c==8:
        ans+=1
print(ans)
import sys
def input(): return sys.stdin.readline().strip()

def main():
    n = int(input())
    ans = 0
    for i in range(n // 2 + 1):
        m = 2 * i + 1
        if m > n: break
        factor = 0
        for j in range(1, int(m ** 0.5)):
            if m % j == 0: factor += 2
        if int(round(m ** 0.5)) ** 2 == m: factor += 1
        if factor == 8: ans += 1
        print("factor[{}]={}".format(m, factor))
    print(ans)


if __name__ == "__main__":
    main()
n = int(input())
s = 0
for i in range(1, n + 1):
  if n % i == 0 and i % 2 == 1:
    s += 1
print(s)
N = int(input())
k = [i for i in range(1,N,2)]
ans = 0
for i in k:
    count = 0
    for j in k:
        if i % j == 0:
            count += 1
    if count == 8:
        ans += 1
print(ans)
n = int(input())
count=1
b = 0
for j in range(105):
    if j % 2==0:
        for i in range(3,n//2):
            if n %2 == 0:
                break
            if n%i == 0:
                count+=1
            if count==8:
                b+=1
                break
print(b)
N = int(input())

total = 0

for n in range(1, N + 2, 2):
    i = 0

    for m in range(1, n + 1):
        if n % m == 0:
            i += 1

    if i == 8:
        total += 1

print(total)
import sys

def resolve():
    N = int(input())
    cnt = 0
    for i in range(1, N, 2):
        if is_8_factors(i):
            cnt += 1
    print(cnt)

def is_8_factors(n):
    nfactors = 2
    upper = n
    div = 3
    while True:
        if upper <= div:
            break
        if n % div == 0:
            nfactors += 2
            upper = n // div
        div += 2

    return True if nfactors == 8 else False

if '__main__' == __name__:
    resolve()
n = int(input())
if(n < 105):
    print(0)
elif(105 <= n < 135):
    print(1)
elif(135 <= n < 165):
    print(2)
else:
    print(3)
l=0
for c in input():
    l+=[0,0,5,1,0,1,2,0,1.5,2.5][int(c)]
print(l)
n = int(input())
ans = 0
for i in range(1,n+1):
  if(n%i==0):
    ans += 1
print(ans)
if int(input())>=105:
  print("Yes")
else:
  print("No")
a=int(input())
if a<105:
  print(0)
elif 105<=a<135:
  print(1)
elif 135<=a<165:
  print(2)
elif 165<=a<189:
  print(3)
else:
  print(4)
n = int(input())
print(n)

def divisor(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

l = len(divisor(n))

if l == 8:
    print(1)
else:
    print(0)
n=int(input())
x=0
for i in range(1,n+1,2):
  cnt=0
  for j in range(1,i+1):
    if n%j==0:
      cnt+=1
  if cnt==8:
    x+=1
print(x)
n = int(input())

res = 0
for i in range(8,n+1):
    yakusu = 0
    for j in range(2,int(i/2)+1,2):
        if(i % j == 0):
            yakusu +=1
    if(yakusu == 8):
        res += 1

print(res)
N = int(input())
cnt = 0
ans=0
for i in range(1,N+1,2):
    for u in range(1,i+1):
        if N%u == 0:
            cnt+=1
    if cnt == 8:
        ans += 1
    cnt = 0
print(ans)
import sys

def resolve():
    N = int(input())
    cnt = 0
    for i in range(1, N, 2):
        if is_8_factors(i):
            cnt += 1
    print(cnt)

def is_8_factors(n):
    nfactors = 2
    upper = n
    div = 3
    while True:
        if upper <= div:
            break
        if n % 3 == 0:
            nfactors += 2
            upper = n // 3
        div += 2

    return True if nfactors == 8 else False

if '__main__' == __name__:
    resolve()
n = int(input())
ans = 0
for i in range(1, n+1):
    c = 2
    for j in range(2, n):
      if n%j==0:
        c += 1
    if c==8:
      ans += 1
print(ans)
N = int(input())
c = 0
for  i in range(1,N+1):
  li = []
  if i < 10:
    continue
  else:
    k = i
    for j in range(2,int(i**(0.5)+1)):
      d = 1
      while k % j == 0:
        k = k/j
        d += 1
      if d != 1:
        li.append(d)
    ss = 1
    for x in li:
      ss *= x
    if ss == 8:
      c += 1
    
print(c)
i = int(input())
lis = []
for n in range(1,i+1,2):
  ans = 0
  for m in range(1,n+1):
    if n % m == 0:
      ans += 1
  if ans == 8:
    print(n)
    lis.append(n)
if len(lis) == 0:
  print(0)
N=int(input())
num=0
for i in range(N):
    for j in range(1,N+1):
        num_1=0
        if i>=j and i%j==0:
            num_1+1
    if num_1==8:
        num+=1
print(num)
n=int(input())
l=[105,165,195]
for i in range(3):
  if n<l[i]:
    print(i)
    exit()
print(3)
def mkdiv(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

if len(mkdiv(int(input())))==8:
  print("Yes")
else:
  print("No")
N = int(input())

ans = 0
for n in range(1,int(N/2)+1):
    if 2*n+1 > N:
        break
    for i in range(1,int(N**(1/2)/2)):
        for j in range(i+1,int(N**(1/2)/2)):
            for k in range(j+1,int(N**(1/2)/2)):
                if 2*n+1 == (2*i+1)*(2*j+1)*(2*k+1):
                    ans += 1

print(ans)
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(input())
a = [105,135,165,195]

if a[0] > n: print(0)
elif a[0] <= n < a[1]: print(1)
elif a[1] <= n < a[2]: print(2)
elif a[2] <= n < a[3]: print(3)
elif a[3] >= n: print(4)
A=[3*5*7,3*5*11,3*3*3*5,3*5*13]
N=int(input())
print(len([x for x in A if x<=N]))
l=0
for c in input():
    l+=[0,0,5,1,0,1,2,0,1.5,2.5][int(c)]
print(int(l))
# 02 AtCoder Beginner Contest 106 B - 105
import sys
import math

N = int(input())


def divisor(n):
    ans = 0
    for i in range(1, int(math.sqrt(n))):
        if n % i == 0:
            ans += 1
        if i != int(math.sqrt(n)):
            ans += 1

    return ans


ans = 0
for i in range(105, N + 1):
    if i % 2 == 0:
        continue

    if divisor(i) == 8:
        ans +=1

print(ans)
# coding = SJIS

n = int(input())

if n >= 105:
    print(1)
else:
    print(0)
import math 
n = int(input())
cnt = 0
if n ==1:
    print(1)
    exit()
for i in range(1,n+1):
    if n % i == 0:
       cnt += 1
print(cnt)
# 105の約数は1, 3, 5, 7, 3 * 5, 3 * 7, 5 * 7, 3 * 5 * 7
# ありえるのは
# ①1, 3, 5, 9, ...
# ②1, 3, 5, 11, ...
# ③1, 3, 5, 13, ...
n = int(input())
if n < 105: print(0)
elif n < 135: print(1)
elif n < 165: print(2)
elif n < 195: print(3)
else: print(4)
N=int(input())
cnt=0
ans=0

for i in range(1,N+1,2):
    for j in range(1,i+1):
        if i%j==0:
            cnt+=1
            if cnt==8:
                ans+=1
print(ans)
n = int(input())


def count_divisors(target):
    _i = 1
    _count = 0
    while _i*_i <= target:
        if target % _i == 0:
            _count += 1
            if _i != target // _i:
                _count += 1
        _i += 1
    return _count


count = 0
for i in range(1, n+1):
    if count_divisors(i) == 8:
        count += 1

print(count)
n = int(input())

ans = 0

for i in range(105, n + 1):
    divisor = []
    for j in range(1, int(i ** 0.5) + 1):
        if i % j == 0:
            divisor.append(j)
            divisor.append(i // j)

    if len(divisor) == 8:
        ans += 1

print(ans)
# B - 105

def yakusu_rekkyo(n):
    yakusu = set()
    for i in range(1, int(pow(n, 0.5)+1)):
        if n%i == 0:
            yakusu.add(i)
            if i!=n//i:
                yakusu.add(n//i)
    return yakusu

N = int(input())
ans = 0
for i in range(105, N+1, 2):
    Y = yakusu_rekkyo(N)
    if len(Y) == 8:
        ans += 1
        
print(ans)
n = int(input())

def divisor(n):
  i = 2
  count = 0
  divs = []
  while n != 1:
    if n % i:
      divs.append(count)
      count = 0
      i+= 1
    else:
      n = n //i
      count += 1
  ans = 1
  for d in divs:
    ans *= d + 1
  return ans

count = 0
for i in range(1,n+1,2):
  if divisor(i) == 8:
    count += 1
print(count)
import sys
def input(): return sys.stdin.readline().strip()

def main():
    n = int(input())
    ans = 0
    for i in range(n // 2 + 1):
        m = 2 * i + 1
        factor = 0
        for j in range(1, int(m ** 0.5)):
            if m % j == 0: factor += 2
        if int(round(m ** 0.5)) ** 2 == m: factor += 1
        if factor == 8: ans += 1
        #print("factor[{}]={}".format(m, factor))
    print(ans)


if __name__ == "__main__":
    main()
n = int(input())
a = n//2
ans = 0
for j in range(1,n+1):
    count = 1
    for i in range(1,a+1):
        if n % i == 0:
            count += 1
        if count >= 8:
            ans +=1
print(ans)
n = int(input())
b = 0
for i in range(1, n+1):
  if i % 2 == 1:
    a = 0
    for j in range(1, i+1):
      if i % j == 0:
        a += 1
    if a == 8:
      b += 1
from math import sqrt

N = int(input())

ans = 0

for i in range(1, N + 1, 2):
    cnt = 0

    for j in range(1, int(sqrt(i))):
        if i % j == 0:
            cnt += 2

    if sqrt(i).is_integer():
        cnt += 1

    if cnt == 8:
        ans += 1

print(ans)
n = int(input())
ans = 0
for i in range(1, n+1):
    cnt = 0
    if i%2 == 1:
        for j in range(1, i+1):
            if i%j == 0:
                cnt += 1
        if cnt == 8:
            print(i)
            ans += 1
print(ans)
n=int(input())

count=0
ans=0
if n<=104:
    print('0')
else:
    for i in range(105,n+1):
        count=0
        for e in range(1,n+1):
            if i%2==0:
                continue
            elif i%e==0:
                count+=1
        if count==8:
            ans+=1
print(ans)
N = int(input())

res = 0

for i in range(1, N+1, 2):
    count = 0
    for j in range(1, N+1):
        if i % j == 0:
            count += 1
    print(i, count)
    if count == 8:
        print(i)
        res += 1

print(res)
S = input()
K = int(input())
ans = 1

for i in range(K):
    if (S[i] != '1'):
        ans = int(S[i])
        break

print(ans)
s=list(input())
k=int(input())

for i in range(k):
    if s[i] != "1":
        print(s[i])
        break
else:
    print(1)
def solve():
    j = 1
    for i in s:
        if i != 1:
            print(i)
            exit()
        if j==K:
            print(i)
            exit()
        j += 1
    print(1)

if __name__=="__main__":
    S = input()
    K = int(input())
#    d = 5*10**15
    s = [int(c) for c in S]
#    print(s)
    solve()
s = input()
k = int(input())
for c in s[:k]:
	if c != '1':
		print(c)
		break
else:
	print(1)
import sys
S = input()
K = int(input())
for k in range(K):
  if S[k] != "1":
    print(S[k])
    sys.exit()
print(1)
S=input()
K=int(input())

ans=1
for i in range(min(len(S),K)):
    if S[i]!='1':
        ans=S[i]
        break
    
print(ans)
S = input()
K = int(input())
if S[0] == '1':
    if K == 1:
        print('1')
    else:
        for i in range(1, len(S)):
            if S[i] != '1':
                break
        if i <= K - 1:
            print(S[i])
        else:
            print('1')
else:
    print(S[0])
s=list(input())
k=int(input())

for i in range(k):
    if s[i]!="1":
        print(s[i])
        break
    elif i==k-1:
        print(s[i])
        break