Harryxun/stf_run huggingface dataset:
n, k = map(int, input().split())
s = str(input())

count = 1
Nums_count = []
now = s[0]
for i in range(1,n):
    if s[i] == str(now):
        count += 1
    else:
        now = s[i]
        Nums_count.append(count)
        count = 1
    if i == n-1:
        Nums_count.append(count)
if len(s) == 1:
    Nums_count.append(1)

Nums_count_rui = [0]
for i in range(len(Nums_count)):
    Nums_count_rui.append(Nums_count[i]+Nums_count_rui[-1])

ans = 0
m = len(Nums_count_rui)

if s[0] == '0' and m <= 2*k:
    ans = n
elif s[0] == '1' and m <= 2*k+1:
    ans = n

for i in range(n-2*k-1):
    if s[i] == '0':
        if i+2*k >= m:
            tot = Nums_count_rui[-1] - Nums_count_rui[i]
        else:
            tot = Nums_count_rui[i+2*k] - Nums_count_rui[i]
    elif s[i] == '1':
        if i+2*k+1 >= m:
            tot = Nums_count_rui[-1] - Nums_count_rui[i]
        else:
            tot = Nums_count_rui[i+2*k+1] - Nums_count_rui[i]
    ans = max(tot, ans)
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
s = str(input())

count = 1
Nums_count = []
now = s[0]
start = 0
for i in range(1,n):
    if s[i] == str(now):
        count += 1
    else:
        Nums_count.append([start, count])
        now = s[i]
        start = i
        count = 1
    if i == n-1:
        Nums_count.append([start, count])
if len(s) == 1:
    Nums_count.append([0,1])

Nums_count_rui = [[-1, 0]]
for i in range(len(Nums_count)):
    Nums_count_rui.append([Nums_count[i][0],Nums_count[i][1]+Nums_count_rui[-1][1]])

# print(Nums_count_rui)
ans = 0
m = len(Nums_count_rui)

if s[0] == '0' and m <= 2*k:
    ans = n
elif s[0] == '1' and m <= 2*k+1:
    ans = n

for i in range(1,m):
    if s[Nums_count_rui[i][0]] == '0':
        if i+2*k-1 >= m:
            tot = Nums_count_rui[-1][1] - Nums_count_rui[i-1][1]
        else:
            tot = Nums_count_rui[i+2*k-1][1] - Nums_count_rui[i-1][1]
    else:
        if i+2*k >= m:
            tot = Nums_count_rui[-1][1] - Nums_count_rui[i-1][1]
        else:
            tot = Nums_count_rui[i+2*k][1] - Nums_count_rui[i-1][1]
    ans = max(tot, ans)
print(ans)
x,y,a,b,c=map(int,input().split())
p,q,r=[reversed(sorted(list(map(int,input().split())))) for i in range(3)]
p=p[0:x]
q=q[0:y]
p.append(0)
q.append(0)
r.append(0)

s=0
i,j,k=0,0,0

for _ in range(x+y):
  if p[i]>=q[j] and p[i]>=r[k]:
    s+=p[i]
    i+=1
  elif q[j]>=r[k]:
    s+=q[j]
    j+=1
  else:
    s+=r[k]
    k+=1
    
print(s)


### FIXED CODE ###

x,y,a,b,c=map(int,input().split())
p,q,r=[list(reversed(sorted(list(map(int,input().split()))))) for i in range(3)]
p=p[0:x]
q=q[0:y]
p.append(0)
q.append(0)
r.append(0)

s=0
i,j,k=0,0,0

for _ in range(x+y):
  if p[i]>=q[j] and p[i]>=r[k]:
    s+=p[i]
    i+=1
  elif q[j]>=r[k]:
    s+=q[j]
    j+=1
  else:
    s+=r[k]
    k+=1
    
print(s)
x = int(input())
if x = 3 or x = 5 or x = 7:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

x = int(input())
if x == 3 or x == 5 or x == 7:
    print("YES")
else:
    print("NO")
for i in range()
if i[4]-i[0] <= i[5]:
  print('Yay!')
else:
  print(':(')


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e-a <= k:
  print('Yay!')
else:
  print(':(')
a = int(input)

if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")

### FIXED CODE ###

a = int(input())

if a < 1200:
    print("ABC")
elif a < 2800:
    print("ARC")
else:
    print("AGC")
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
num=0
for i in range(n):
            if(v[i]-c[i]>0):
                num+=v[i]-d[i]
print(num)


### FIXED CODE ###

n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
d=[]
max=0
num=0
for i in range(n):
            d.append(v[i]-c[i])
"""
for i in range(n-1):
    num=d[i]

    for k in range(n-i-1):
        if(num+d[i+1+k]>max):
            max=num+d[i+1+k]
"""
d.sort()
d.reverse()
for i in range(n):
    num=max+d[i]
    if num>max:
        max=num

print(max)
while True:
    num = map(int, raw_input().split())
    if len(num) != 1:
        print "%d %d %d" % (min(num),max(num),sum(num))
        break

### FIXED CODE ###

while True:
    l = map(int, raw_input().split())
    num = map(int, raw_input().split())
    print "%d %d %d" % (min(num),max(num),sum(num))
    break
import sys
sys.setrecursionlimit(10 ** 9)
N, X = map(int, input().split())

def f(a, b):
    if a == b:
        return a
    if a >= b:
        a, b = b, a
    return 2 * a + f(a, b - a)

print (N + f(N - X, X))

### FIXED CODE ###

N, X = map(int, input().split())

ans = N
a = N - X
b = X
while a != b:
    if a >= b:
        a, b = b, a
    if b%a != 0:
        ans += 2 * a * (b//a)
        b = b%a
    else:
        ans += 2 * a * (b//a - 1)
        b = a
print (ans + a)
m=24*60*60
while True:
	n=int(input())
	if n==0:break
#	dp=[0]*(m+1)
#	for _ in range(n):
#		a,d=input().split()
#		a,b,c=map(int,a.split(':'));
#		d,e,f=map(int,d.split(':'));
#		dp[a*3600+b*60+c]+=1
#		dp[d*3600+e*60+f]-=1
#	for i in range(m):
#		dp[i+1]+=dp[i]
#	print(max(dp))

### FIXED CODE ###

m=24*60*60
while True:
	n=int(raw_input())
	if n==0:break
	dp=[0]*(m+1)
	for _ in range(n):
		a,d=raw_input().split()
		a,b,c=map(int,a.split(':'));
		d,e,f=map(int,d.split(':'));
		dp[a*3600+b*60+c]+=1
		dp[d*3600+e*60+f]-=1
	for i in range(m):
		dp[i+1]+=dp[i]
	print(max(dp))
N = int(input())    
color_list =  [int(input())]
for i in range(N-1):
    new_value = int(input())
    if(new_value > color_list[0]):
        color_list[0] = new_value
    elif(new_value <= color_list[-1]):
        color_list.append(new_value)
    else:
        for i in range(len(color_list)):
            break
print(len(color_list))

### FIXED CODE ###

def set_ball(i):
    index = i
    ball_count = 0
    while(True):
        ball_count += ball_status[index]
        index += i + 1
        if(index  >= N):
            break
    return (ball_count % 2) != a_list[i]

N = int(input())
a_list = list(map(int, input().strip().split()))

ball_status = [0 for i in range(N)]
for i in range(N):
    flag = set_ball(N-1-i)
    if(flag):
        ball_status[N-1-i] = 1
throw_balls = sum(ball_status)
print(throw_balls)
if(throw_balls > 0):
    ans = ""
    for i in range(N):
        if(ball_status[i] == 1):
            ans += str(i+1)
            ans += " "
    print(ans[:-1])
x=int(input())
k=360%x
j=360//x
v=k
while 360%k!=0:
    k=360%k
    v+=k
print(j*(360//v))

### FIXED CODE ###

def do():
    x=int(input())
    k=360%x
    j=360//x
    v=k
    if k==0:
        return j
    while 360%k!=0:
        k=360%k
        v+=k
    v1=360//v
    return j*v1
print(do())
class union_find:
    def __init__(self, N):
        self.par = [i for i in range(N)]
        self.size = [1 for i in range(N)]
        self.excluded = [0 for i in range(N)]
    
    def root(self, a):
        if self.par[a] == a:
            return a
        else:
            # 経路圧縮
            self.par[a] = self.root(self.par[a])
            return self.par[a]
    
    def same(self, a, b):
        return self.root(a) == self.root(b)
    
    def unite(self, a, b):
        if not self.same(a, b):
            self.size[self.root(b)] += self.get_union_size(a)
            self.par[self.root(a)] = self.root(b)
    
    def friend(self, a, b):
        self.unite(a, b)
        self.excluded[a] += 1
        self.excluded[b] += 1
    
    def block(self, a, b):
        if self.same(a, b):
            self.excluded[a] += 1
            self.excluded[b] += 1

    def get_union_size(self, a):
        return self.size[self.root(a)]
    
    def get_friend_sugestion_size(self, a):
        return self.get_union_size(a) - 1 - self.excluded[a]

N, M, K = map(int, input().split())
UF = union_find(N)
for i in range(M):
    A, B = map(int, input().split())
    UF.friend(A-1, B-1)
for i in range(K):
    A, B = map(int, input().split())
    UF.block(A-1, B-1)
print(*[UF.get_friend_sugestion_size(x) for x in range(N)])

### FIXED CODE ###

import sys 
sys.setrecursionlimit(1000000000)

class union_find:
    def __init__(self, N):
        self.par = [i for i in range(N)]
        self.size = [1 for i in range(N)]
        self.excluded = [0 for i in range(N)]
    
    def root(self, a):
        if self.par[a] == a:
            return a
        else:
            # 経路圧縮
            self.par[a] = self.root(self.par[a])
            return self.par[a]
    
    def same(self, a, b):
        return self.root(a) == self.root(b)
    
    def unite(self, a, b):
        if not self.same(a, b):
            self.size[self.root(b)] += self.get_union_size(a)
            self.par[self.root(a)] = self.root(b)
    
    def friend(self, a, b):
        self.unite(a, b)
        self.excluded[a] += 1
        self.excluded[b] += 1
    
    def block(self, a, b):
        if self.same(a, b):
            self.excluded[a] += 1
            self.excluded[b] += 1

    def get_union_size(self, a):
        return self.size[self.root(a)]
    
    def get_friend_sugestion_size(self, a):
        return self.get_union_size(a) - 1 - self.excluded[a]

N, M, K = map(int, input().split())
UF = union_find(N)
for i in range(M):
    A, B = map(int, input().split())
    UF.friend(A-1, B-1)
for i in range(K):
    A, B = map(int, input().split())
    UF.block(A-1, B-1)
print(*[UF.get_friend_sugestion_size(x) for x in range(N)])
s=input()

for i in range(4):
  s[i]=int(s[i])

if s[0]+s[1]+s[2]+s[3]==7:
  print('s[0]+s[1]+s[2]+s[3]=7')
if s[0]+s[1]+s[2]-s[3]==7:
  print('s[0]+s[1]+s[2]-s[3]=7')
if s[0]+s[1]-s[2]+s[3]==7:
  print('s[0]+s[1]-s[2]+s[3]=7')
if s[0]-s[1]+s[2]+s[3]==7:
  print('s[0]-s[1]+s[2]+s[3]=7')
if s[0]-s[1]+s[2]-s[3]==7:
  print('s[0]-s[1]+s[2]-s[3]=7')
if s[0]-s[1]-s[2]+s[3]==7:
  print('s[0]-s[1]-s[2]+s[3]=7')
if s[0]+s[1]-s[2]-s[3]==7:
  print('s[0]+s[1]-s[2]-s[3]=7')
if s[0]-s[1]-s[2]-s[3]==7:
  print('s[0]-s[1]-s[2]-s[3]=7')


 


### FIXED CODE ###

import sys
S=input()
a,b,c,d=S[0],S[1],S[2],S[3]
lst=['+','-']
for i in lst:
  for j in lst:
    for k in lst:
      if eval(a+i+b+j+c+k+d+'==7'):
        print(a+i+b+j+c+k+d+'=7')
        sys.exit()
S = input()
T = input()

T_plus = T[-1]
T_a = T[:-1]

if S == T_a:
  print("Yes")
else:
  print("No")
 print("Yes" if S==T else "No")

### FIXED CODE ###

S = input()
T = input()

T_plus = T[-1]
T_a = T[:-1]

print("Yes" if S==T_a else "No")
import sys

MOD = 1000000007

N = int(input())
a = list(map(int,input().split()))

if(N%2 == 0):
    a.sort()
    for i in range(N//2):
        n = 2*i + 1
        if(a[2*i] != n or a[2*i + 1] != n):
            print(0)
            sys.exit()
    print((2 ** (N//2)) % MOD)
else:
    a.sort()
    if(a[0] != 0 or a[1] == 0 ):
        print(0)
        sys.exit()
    for i in range((N-1)//2):
        n = 2*i + 2
        if(a[2*i + 1] != n or a[2*i + 2] != n):
            print(0)
            sys.exit()
    print((2 ** ((N-1)//2)) % MOD)


### FIXED CODE ###

import sys

MOD = 1000000007

N = int(input())
a = list(map(int,input().split()))

if(N%2 == 0):
    a.sort()
    for i in range(N//2):
        n = 2*i + 1
        if(a[2*i] != n or a[2*i + 1] != n):
            print(0)
            sys.exit()
    print((2 ** (N//2)) % MOD)
else:
    a.sort()
    if(a.count(0) != 1):
        print(0)
        sys.exit()
    for i in range((N-1)//2):
        n = 2*i + 2
        if(a[2*i + 1] != n or a[2*i + 2] != n):
            print(0)
            sys.exit()
    print((2 ** ((N-1)//2)) % MOD)
import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 y=(c*d-a*f)/(b*d-a*e)
 print(f'{(c-b*y)/a:.3f} {y:.3f}")


### FIXED CODE ###

import sys
for e in sys.stdin:
 a,b,c,d,e,f=map(int,e.split())
 y=(c*d-a*f)/(b*d-a*e)
 print(f'{(c-b*y)/a:.3f} {y:.3f}')
n,m=map(int,input().split())
a=[]
for _ in range(m):
    a.append(int(input()))
ans=1
a.sort()
d={0:1,1:1,2:2,3:3,4:5,5:8,6:13}
def func(n):
    if n in d:
        return d[n]
    else:
        v = func(n-1)+func(n-2)%(10**9+7)
        d[n]=v
        return v
ps=-1
a.append(n+1)
for ai in a:
    c=ai-ps-2
    ps=ai
    if c<0:
        print(0)
        exit()
    c=func(c)
    ans*=c
    ans%=10**9+7

print(ans%(10**9+7))

### FIXED CODE ###

n,m=map(int,input().split())
a=[]
for _ in range(m):
    a.append(int(input()))
ans=1
a.sort()
d={0:1,1:1,2:2,3:3,4:5,5:8,6:13,99500:49759705584609,99501:49760296517401}
def func(n):
    if n in d:
        return d[n]
    else:
        v = (func(n-1)+func(n-2))%(10**9+7)
        d[n]=v
        return v
ps=-1
a.append(n+1)
for ai in a:
    c=ai-ps-2
    ps=ai
    if c<0:
        print(0)
        exit()
    c=func(c)
    ans*=c
    ans%=10**9+7

print(ans%(10**9+7))
n = int(input())
dat = []
for i in range(n):
    a,b = map(int, input().split())
    dat.append([a,b])
dat2 = []
for i in range(n):
    x1, y1 = dat[i]
    for j in range(i+1, n):
        x2, y2 = dat[j]
        dat2.append( (x1-x2, y1-y2) )
import collections
c = collections.Counter(dat2)
#print(c)
print(n - c.most_common(1)[0][1])

### FIXED CODE ###

n = int(input())
dat = []
for i in range(n):
    a,b = map(int, input().split())
    dat.append([a,b])
dat2 = []
if n == 1:
    print(1)
else:
    for i in range(n):
        x1, y1 = dat[i]
        for j in range(n):
            if i == j:
                continue
            x2, y2 = dat[j]
            dat2.append( (x1-x2, y1-y2) )
    import collections
    c = collections.Counter(dat2)
    #print(c)
    ta, tb = c.most_common(1)[0][0]
    res = 0
    for i in range(n):
        canwarp = False
        x1, y1 = dat[i]
        for j in range(n):
            if i == j:
                continue
            x2, y2 = dat[j]
            if x1-x2 == ta and  y1-y2 == tb:
                canwarp = True
        if canwarp:
            continue
        else:
            res += 1
    print(res)
A = list(input().split())
print("Yes" if len(set(A)) == 2 and (A[0].count(A) == 1 or A[0].count(A) == 2) else "No")

### FIXED CODE ###

A = list(input().split())
print("Yes" if len(set(A)) == 2 else "No")
n,a,b = map(int,input().split())
if a==0:
    print(0)
else :
    x = n/(a+b)
    y =n%(a+b)
    print(x*a+y)

    

### FIXED CODE ###

x = set(input())
print('No' if len(x)==1 else 'Yes')
input()
a = list(map(int,input().split()))
ans = 1
for n in a:
    ans *= n
    if ans <= 10**18:
        print(ans)
    break:
print(-1)

### FIXED CODE ###

n=input()
a = list(map(int,input().split()))

if 0 in a:
    print(0)
    exit()

ans = 1
for n in a:
    ans*=n
    
    if ans > 10**18:
        ans = -1
        break
    
print(ans)
import numpy as np

n = int(input())
a = list(map(int,input().split()))
a = np.array(a,dtype=np.int64)
b = [((a>>i)&1).sum() for i in range(21)]
li = []
for i in a:
    c = np.array([((i>>j)&1) for j in range(21)],dtype=np.int64)
    d = b-c
    point = 0
    for i in range(31):
        if d[i]%2 == 1:
            point += 2**(i)
    li.append(point)

print(*li)

### FIXED CODE ###

import numpy as np

n = int(input())
a = list(map(int,input().split()))
now = 0
for i in a:
    now ^= i
li = []
for i in a:
    li.append(i^now)

print(*li)
admission = []
n = int(input())
admission.append(map,int(input().split()))

for i in range(n):
    if admission[n] % 2 == 0:
        if admission[n] % 3 == 0 or admission[n] % 5 == 0:
            print("APPROVE")
        else:
            print("DENIED")

### FIXED CODE ###

n = int(input())
a = map(int,input().split())
for l in a:
    if l % 2 ==0:
        if l % 3 == 0 or l % 5 == 0:
            continue
        else:
            print("DENIED")
            quit()
print("APPROVED")
N = int(input())
X_bin = input()

X_int = int(X_bin, 2)  # bin => int
dp = {1: 1}


def calc_ans(next_int):
    key = next_int
    if key in dp.keys():
        ans = dp[key]
    else:
        next_bin = format(next_int, 'b')
        # popcount
        cnt = 0
        for i in next_bin:
            if i == '1':
                cnt += 1
        next_int = next_int % cnt
        if next_int > 0:
            ans = calc_ans(next_int) + 1
        else:
            ans = 1
        dp[key] = ans
    return ans


for i in range(N):
    if X_bin[i] == '1':
        print(calc_ans(X_int - (2**(N-i-1))))
    else:
        print(calc_ans(X_int + (2**(N-i-1))))


### FIXED CODE ###

N = int(input())
X_bin = input()
#N = 10**5
#X_bin = '1' * N

X_int = int(X_bin, 2)  # bin => int


def calc_bin_cnt(next_int):
    if next_int == 0:
        return 0
    next_bin = bin(next_int)[2:]
    # popcount
    cnt = 0
    for i in next_bin:
        if i == '1':
            cnt += 1
    return cnt


def calc_ans(next_int, cnt=None):
    if next_cnt == 0:
        return 0
    if next_int == 0:
        return 1
    if cnt is None:
        cnt = calc_bin_cnt(next_int)
    next_int = next_int % cnt
    if next_int > 0:
        ans = calc_ans(next_int) + 1
    else:
        ans = 1
    return ans


X_cnt = calc_bin_cnt(X_int)
f_p = X_int % (X_cnt+1)
if X_cnt-1 == 0:
    f_m = 0
else:
    f_m = X_int % (X_cnt-1)
for i in range(N):
    if X_bin[i] == '1':
        next_cnt = X_cnt - 1
        if next_cnt == 0:
            next_int = 0
        else:
            next_int = f_m - pow(2, (N-i-1), next_cnt)  # マイナスでも正しく求まる？
    else:
        next_cnt = X_cnt + 1
        next_int = f_p + pow(2, (N-i-1), next_cnt)
    print(calc_ans(next_int, next_cnt))
    #calc_ans(next_cnt, next_cnt)
import sys
N = int(sys.stdin.readline())


def dev(x):
    global cnt
    if x % 2 == 0:
        cnt += 1
        dev(x / 2)
    return cnt


min_cnt = 0
for i in range(2, N + 1, 2):
    cnt = 0
    result = dev(i)
    if min_cnt < result:
        min_i = i
        min_cnt = result
print(min_i)



### FIXED CODE ###

m = int(input())
a = 1
for c in range(7):
  if (2 ** c) > m:
    break
  a = (2 ** c)
 
print(a)
x, a, b = map(int, input().split())
if x < b - a:
  print("dangerous")
elif x <= b - a and 0 < x - (a - b):
  primt("safe")
elif 0 >= b - a:
  print("delicious")

### FIXED CODE ###

x, a, b = map(int, input().split())
if a >= b:
    print('delicious')
elif a + x >= b:
    print('safe')
else:
    print('dangerous')
N, X = map(int, input().split())
burger  = [1] * (N+1)
patty = [1] * (N+1)
for i in range(1, N+1):
    burger[i] = burger[i-1] * 2 + 3
    patty[i] = patty[i-1] * 2 + 1


def func(level, x):
    if burger[level-1] + 1 <= x:
        return func(level-1, x-burger[level-1]-2) + patty[level-1] + 1
    else:
        return func(level-1, x-1)
    if level == 0:
        return 0


print(func(N, X))


### FIXED CODE ###

N, X = map(int, input().split())
burger  = [1] * N
patty = [1] * N
for i in range(1, N):
    burger[i] = burger[i-1] * 2 + 3
    patty[i] = patty[i-1] * 2 + 1


def func(level, x):
    if level == 0:
        return 0 if x <= 0 else 1
    if burger[level-1] + 1 < x:
        return func(level-1, x-burger[level-1]-2) + patty[level-1] + 1
    else:
        return func(level-1, x-1)


print(func(N, X))
c=0
x=[-1,0,1,0]
y=[0,-1,0,1]
buf=[]
p=0
def count(h,w,S,table,H,W):
    global buf,x,y,p
    if buf or p==0:
        for i in range(4):
            if h+y[i]>=0 and h+y[i]<H and w+x[i]>=0 and w+x[i]<W:
                if table[h+y[i]][w+x[i]]==-1:
                    if S[h][w]=='.' and S[h+y[i]][w+x[i]]=='#':
                        table[h+y[i]][w+x[i]]=table[h][w]+1
                        buf.append([h+y[i],w+x[i]])
                    elif S[h][w]=='#' and S[h+y[i]][w+x[i]]=='.':
                        table[h+y[i]][w+x[i]]=table[h][w]+1
                        buf.append([h+y[i],w+x[i]])
        if buf:
            a=buf.pop(0)
            count(a[0],a[1],S,table,H,W)
    elif not(buf) and p==0:
        p+=1
        count(h,w,S,table,H,W)

H,W=map(int,input().split())
S=[]
for i in range(H):
    S.append(input())
for h in range(H):
    for w in range(W):
        if S[h][w]=='#':
            table=[[-1 for j in range(W)]for i in range(H)]
            table[h][w]=0
            count(h,w,S,table,H,W)
            for k in range(H):
                for l in range(W):
                    if table[k][l]%2==1 and table[k][l]!=-1:
                        c+=1
print(c)


### FIXED CODE ###

import sys
c=0
b=0
wi=0
x=[-1,0,1,0]
y=[0,-1,0,1]
buf=[]
def one():
    return -1
def count(h,w,S,table,H,W,index):
    global buf,x,y,b,wi
    if index==1:
        b+=1
    else:
        wi+=1
    if index==1:
        S[h][w]='@'
    for i in range(4):
        if h+y[i]>=0 and h+y[i]<H and w+x[i]>=0 and w+x[i]<W:
            if table[h+y[i]][w+x[i]]==-1:
                if index==0 and S[h+y[i]][w+x[i]]=='#':
                    table[h+y[i]][w+x[i]]=1
                    buf.append([h+y[i],w+x[i],1])
                elif index==1 and S[h+y[i]][w+x[i]]=='.':
                    table[h+y[i]][w+x[i]]=1
                    buf.append([h+y[i],w+x[i],0])
    if buf:
        a=buf.pop(0)
        count(a[0],a[1],S,table,H,W,a[2])
sys.setrecursionlimit(10000000)
H,W=map(int,input().split())
T=[]
table=[[-1 for j in range(W)] for i in range(H)]
for i in range(H):
    T.append(input())
S=[['' for j in range(W)]for i in range(H)]
for h in range(H):
    for w in range(W):
        S[h][w]=T[h][w]
for h in range(H):
    for w in range(W):
        if S[h][w]=='#':
            table[h][w]=0
            count(h,w,S,table,H,W,1)
            c+=b*wi
            b=0
            wi=0
print(c)
a,b,c=map(str,input().split())
d,e,f=map(str,input().split())
if (a==f and b==e and c==d):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a = input()
b = input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print("YES")
else:
  print("NO")
N = int(input(()))
A = list(map(int, input().split()))

hist = [0]*9
for i in A:
    hist[i//400] += 1

ansmin = 0
for i in hist[:-1]:
    if i > 0:
        ansmin += 1
print("{} {}".format(ansmin, ansmin+hist[-1]))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))

colors = [0]*9
for a in A:
    colors[min(8, a//400)] += 1
ansmin = 0
for c in colors[:-1]:
    if c:
        ansmin += 1
x = 0
if ansmin < colors[-1]:
    x = 1
print("{} {}".format(max(ansmin, x), ansmin+colors[-1]))
#coding:utf-8
r,D,x = map(int,input().split())
x2001 = r * x - D
x2002 = r * x2001 - D
x2003 = r * x2002 - D
x2004 = r * x2003 - D
x2005 = r * x2004 - D
x2006 = r * x2005 - D
x2007 = r * x2006 - D
x2008 = r * x2007 - D
x2009 = r * x2008 - D
x2010 = r * x2009 - D
X = '''x2001
x2002
x2003
x2004
x2005
x2006
x2007
x2008
x2009
x2010'''
print(int(X))

### FIXED CODE ###

#coding:utf-8
r,D,x = map(int,input().split())
x2001 = r * x - D
x2002 = r * x2001 - D
x2003 = r * x2002 - D
x2004 = r * x2003 - D
x2005 = r * x2004 - D
x2006 = r * x2005 - D
x2007 = r * x2006 - D
x2008 = r * x2007 - D
x2009 = r * x2008 - D
x2010 = r * x2009 - D
print(x2001)
print(x2002)
print(x2003)
print(x2004)
print(x2005)
print(x2006)
print(x2007)
print(x2008)
print(x2009)
print(x2010)
A,B=map(int, input().split())
if A+B%2 = 0:
  K=(A+B)/2
  print(K)
else:
  print('impossible')

### FIXED CODE ###

A,B=map(int, input().split())
if (A+B)%2 == 0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')
r,d,x = map(int,input().split())
p = []
for i in range(10):
    x = r * x - d
    p[i] = x

for i in range(10):
    print(p[i])

### FIXED CODE ###

r,d,x = map(int,input().split())
p = []
for i in range(10):
    x = r * x - d
    p.append(x)

for i in range(10):
    print(p[i])
import math

l,r=map(int, input().split())
s=set()
for i in range(l+1, r):
    s.add(i%2019)
s=list(s)

ans=math.inf
for i in range(len(s)):
    for j in range(i+1, len(s)):
        ans=min(ans, (s[i]*s[j])%2019)

print(ans)


### FIXED CODE ###

l,r=map(int, input().split())

if r-l > 2019:
    s=list(range(0, 2019))
else:
    s=set()
    for i in range(l, r+1):
        s.add(i%2019)
    s=list(s)

ans=float('inf')
for i in range(len(s)):
    for j in range(i+1, len(s)):
        ans=min(ans, (s[i]*s[j])%2019)

print(ans)
n,k = map(int,input().split())
li = list(map(int,input().split()))
mod = 10**9 +7

ans_1 = 0
ans_2 = 0
for i in range(n-1):
  for j in range(i+1,n):
    if li[i] > li[j]:
      ans_1+= 1
for i in range(n):
  for j in range(n):
    if li[i] < li[j]:
      ans_2 += 1
ans = k*ans_1 + 0.5*k*(k-1)%mod*ans_2
print(ans_1)
print(ans_2)
print(ans%mod)

### FIXED CODE ###

m,d = map(int,input().split())
ans = 0
for i in range(1,m+1):
  for j in range(1,d+1):
    if j%10 >= 2 and j//10 >= 2 and (j%10) * (j//10) ==i:
      ans += 1
print(ans)