Harryxun/stf_run huggingface dataset:
m, a, b = map(int, input().split())
n = list(str(n))

count = 0
for j in range(m):
    l = [n[i] for i in range(len(j))]
    sum = sum(l)
    if a <= sum and sum <= b:
        count += 1
print(count)


### FIXED CODE ###

m, a, b = map(int, input().split())

x = []
for j in range(1, m + 1):
    n = list(str(j))
    l = [int(n[i]) for i in range(len(n))]
    if len(l) == 1:
        l.append(0)
    s = sum(l)
    if a <= s and s <= b:
        x.append(j)
print(sum(x))
a = input()
if 9 in a:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a = input()
if '9' in a:
  print('Yes')
else:
  print('No')
import sys
import heapq

N, M = list(map(int, input().split()))
possiblyValidJobs = {}
for line in sys.stdin:
    A, B = map(int, line.split())
    if A > M:
        continue

    if A in possiblyValidJobs:
        possiblyValidJobs[A] += 1
    else:
        possiblyValidJobs[A] = 1

validJobsOnThisDay = []
ans = 0
for daysBeforeDeadline in range(1, M + 1):
    if daysBeforeDeadline in possiblyValidJobs:
        for wage in possiblyValidJobs[daysBeforeDeadline]:
            heapq.heappush(validJobsOnThisDay, -wage)
    if validJobsOnThisDay:
        ans += -heapq.heappop(validJobsOnThisDay)
print(ans)


### FIXED CODE ###

import sys
import heapq

N, M = list(map(int, input().split()))
jobs = []
for line in sys.stdin:
    A, B = map(int, line.split())
    if A > M:
        continue
    jobs.append((A, B))

jobs.sort(reverse=True)

q = []
ans = 0
for i in range(1, M + 1):
    while jobs and jobs[-1][0] <= i:
        A, B = jobs.pop()
        heapq.heappush(q, -B)

    if q:
        ans += -heapq.heappop(q)
print(ans)
N = int(input())
light_rule = {n:int(input())-1 for n in range(N)}

light = ["1"]+["0"]*(N-1)
searched = {"".join(light):1}

flag = 0
num = 0
bottun = 0
for _ in range(N):
    if light[2] == "1":
        flag = 1
        break
    num += 1
    # print(bottun, light_rule[bottun])
    light[bottun] = "0"
    light[light_rule[bottun]] = "1"
    bottun = light_rule[bottun]
    # print(light)
    if searched.get("".join(light)):
        break
    else:
        searched["".join(light)] = 1
    
if flag:
    print(num)
else:
    print(-1)

### FIXED CODE ###

N = int(input())
light_rule = {n:int(input())-1 for n in range(N)}

light = ["1"]+["0"]*(N-1)

flag = 0
num = 0
bottun = 0
for _ in range(N):
    if light[1] == "1":
        flag = 1
        break
    num += 1
    # print(bottun, light_rule[bottun])
    light[bottun] = "0"
    light[light_rule[bottun]] = "1"
    bottun = light_rule[bottun]
    # print(light)
    
if flag:
    print(num)
else:
    print(-1)
n, m = map(int, input().split())
x = sorted(list(map(int, input().split())))
d = []
for i in range(m-1):
    d.append(x[i+1] - x[i])
    
ans = 0
if n>=m:
    ans = 1
else:
    for i in range(n):
        if i == 0:
            ans += x[:d.index(sorted(d)[::-1][i])+1][-1] - x[:d.index(sorted(d)[::-1][i])+1][0]
        elif i == n-1:
            ans += x[d.index(sorted(d)[::-1][i-1])+1:][-1] - x[d.index(sorted(d)[::-1][i-1])+1:][0]
        else:
            ans += x[d.index(sorted(d)[::-1][i-1])+1:d.index(sorted(d)[::-1][i])+1][-1] - x[d.index(sorted(d)[::-1][i-1])+1:d.index(sorted(d)[::-1][i])+1][0]

print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
x = sorted(list(map(int, input().split())))
d = []
if n>=m or m==1:
    print(0)
elif n<m:
    for i in range(m-1):
        d.append(x[i+1] - x[i])
    print(sum(sorted(d)[:m-n]))
n = int(input())

l = [0] * n
for i in range(n):
    l[i] = input()

k = set(l)
m = 0
ans = []

for i in k:
    cnt = l.count(i)
    if cnt > m:
        m = cnt
        ans.clear()
        ans.append(i)
    elif cnt == m:
        ans.append(i)

ans.sort()

for i in ans:
    print(i)

### FIXED CODE ###

n = int(input())

words = {}

for i in range(n):
    key = input()
    if key not in words:
        words[key] = 0
    words[key] += 1

l = []
th = max(words.values())

for i,j in words.items():
    if th == j:
        l.append(i)

l.sort()

print(*l, sep="\n", end="")
wOFFSETS = [(-1,0),(0,-1),(0,1),(1,0)]

H, W = map(int, input().split())

Ses = []
for _ in range(H):
    Ses.append(input())

for y in range(H):
    for x in range(W):
        if Ses[y][x] == "#":
            found = False
            for dx, dy in OFFSETS:
                now_x = x+dx
                now_y = y+dy
                if now_x < 0 or now_x >= W:
                    continue
                if now_y < 0 or now_y >= H:
                    continue
                if Ses[now_y][now_x] == "#":
                    found = True
                    break
            if not found:
                print("No")
                exit()

print("Yes")


### FIXED CODE ###

OFFSETS = [(-1,0),(0,-1),(0,1),(1,0)]

H, W = map(int, input().split())

Ses = []
for _ in range(H):
    Ses.append(input())

for y in range(H):
    for x in range(W):
        if Ses[y][x] == "#":
            found = False
            for dx, dy in OFFSETS:
                now_x = x+dx
                now_y = y+dy
                if now_x < 0 or now_x >= W:
                    continue
                if now_y < 0 or now_y >= H:
                    continue
                if Ses[now_y][now_x] == "#":
                    found = True
                    break
            if not found:
                print("No")
                exit()

print("Yes")
x1, y1, x2, y2 = map(float, input().split())
print("{:4f}".format((x2-x1)**2 + (y2-y1)**2)**0.5)


### FIXED CODE ###

x1, y1, x2, y2 = map(float, input().split())
print("{:.5f}".format(((x2-x1)**2 + (y2-y1)**2)**0.5))
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 1:
        for i in range(2,n+1):
            kakekake = kakekake * kakeru[i]
if kakekake > 10:
    print(-1)
print(kakekake)

### FIXED CODE ###

n = int(input())
b = 1
a = list(map(int,input().split()))
if 0 in a:
    print(0)
else:
    for i in range(n):
        b *= a[i]
        if b > 10**18:
            print(-1)
            break
    if b <=10**18:
        print(b)
from decimal import *
def ABC_169_C():
    getcontext().prec=28
    i=0
    A,B= map(float, input().split())
    k=Decimal(A)*Decimal(B)
    k=str(k)
    i=k.index('.')
    print(int(k[0:i]))

if __name__ == '__main__':

    ABC_169_C()

### FIXED CODE ###

from decimal import *
def ABC_169_C():
    getcontext().prec=28
    A,B= map(float, input().split())
    k=Decimal(str(A))*Decimal(str(B))
    print(int(k))

if __name__ == '__main__':

    ABC_169_C()
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [input() for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

n = input()
x = ipnl(n)
print(len(set(x)))

### FIXED CODE ###

#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [input() for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

n = inp()
x = ipnl(n)
print(len(set(x)))
a,b = map(int,input().split())
c = a * b
d = 2 * (a + b)
print(str(c)''str(d) )

### FIXED CODE ###

a,b = map(int,input().split())
x = a * b
y = 2 * a + 2 * b
print('{} {}'.format(x,y))
s = str(input())
l = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN']
 
if s == "SUN":
  print(7)
else:
  for i in range(7):
    if s == l[i]
       print(i)

### FIXED CODE ###

s=input()
l=['SUN','MON','TUE','WED','THU','FRI','SAT']
for i in range(7):
  if s==l[i]:print(7-i)
x = input("")
print(x ** 3)



### FIXED CODE ###

x = int(input())
print(x ** 3)
import math.py

x1, y1, x2, y2 = raw_input().split()

print sqrt((float(x2)-float(x1))**2 + (float(y2)-float(y1))**2)

### FIXED CODE ###

import math

x1, y1, x2, y2 = map(float, raw_input().split())
print math.sqrt((x2-x1)**2 + (y2-y1)**2)
# -*- coding: utf-8 -*-

import numpy as np

EDPC = "https://atcoder.jp/contests/DP/"
TDPC = "https://atcoder.jp/contests/tDPc/tasks"

############### TESTCASE ###############
test = ""
#test = \
"""
3 8
3 30
4 50
5 60
ans 90
"""

"""
5 5
1 1000000000
1 1000000000
1 1000000000
1 1000000000
1 1000000000
ans 5000000000(>int32)
"""

"""
6 15
6 5
5 6
6 4
6 6
3 5
7 2
ans 17
"""
########################################
test = list(reversed(test.strip().splitlines()))
if test:
    def input2():
        return test.pop()
else:
    def input2():
        return input()
########################################
#np.maximum(*arrays) == np.max(np.vstack(*arrays), axis=0)
(np.maximum(np.array([1,3,2]), np.array([2, 1, 3])) == 
 np.max(np.vstack([np.array([1,3,2]), np.array([2, 1, 3])]), axis=0)).all()
################# MAIN #################

N, W = map(int, input2().split())
WV = np.array([tuple(map(int, input2().split())) for _ in range(N)], 
               dtype="int64")

dp = np.zeros(W + 1, dtype="int64")
for w, v in WV:
    dp[W:w-1:-1] = np.max(np.vstack([dp[W:w-1:-1], dp[W-w::-1] + v]), axis=0)
    
print(dp[-1])


### FIXED CODE ###

# -*- coding: utf-8 -*-

import numpy as np

EDPC = "https://atcoder.jp/contests/DP/"
TDPC = "https://atcoder.jp/contests/tdpc/tasks"

############### TESTCASE ###############
test = ""
#test = \
"""
3 8
3 3
4 5
5 6
ans 9
"""

"""
6 15
6 5
5 6
6 4
6 6
3 5
7 2
ans 17
"""

"""
N<100, W<10*9
wi<10**9, vi<10**3 
"""
########################################
test = list(reversed(test.strip().splitlines()))
if test:
    def input2():
        return test.pop()
else:
    def input2():
        return input()
########################################
#np.maximum(*arrays) == np.max(np.vstack(*arrays), axis=0)
#(np.maximum(np.array([1,3,2]), np.array([2, 1, 3])) == 
# np.max(np.vstack([np.array([1,3,2]), np.array([2, 1, 3])]), axis=0)).all()
################# MAIN #################

N, W = map(int, input2().split())
WV = np.array([tuple(map(int, input2().split())) for _ in range(N)], dtype="int64")
Wsum = np.sum(WV[:, 0])
Vsum = np.sum(WV[:, 1])

dp = np.full(Vsum+1, Wsum, dtype="int64")
for w, v in WV:
    dp[:Vsum-v+1] = np.min(np.vstack([dp[:Vsum-v+1], dp[v:] - w]), axis=0)
    
print(np.where(dp < W+1)[0][-1])
ans=list(map(int,input().split()))
dic=[]
for x in ans:
  if(x!=5 or x!=7):
    print("NO")
    break
  else:
  	dic[str(x)]=dic.get(str(x),0）+1
if(dic["5"]!=2 and dic["7"]!=1):
	print("NO")
else:
  	print("YES")


### FIXED CODE ###

ans=list(map(int,input().split()))
dic={}
flg=0
for x in ans:
    if(x!=5 and x!=7):
        flg=-1
        break
    else:
        dic[str(x)]=dic.get(str(x),0)+1
if(flg==-1):
    print("NO")
else:
    if(dic["5"]!=2 or dic["7"]!=1):
	       print("NO")
    else:
 	      print("YES")
a,b=map(int,input().split)
print(a if a<=b else a-1)

### FIXED CODE ###

a,b=map(int,input().split())
print(a if a<=b else a-1)
# a: 総数hiki， b: 足の数
a, b = map(int, input().split())

# かめiひき
ans = 'No'
for i in range(a+1):
  total = 4*i + 2*(a-i)
  if total == b:
    ans = 'Yes'

print(ans)

### FIXED CODE ###

a_list = list(map(int, input().split()))
print(1 + a_list.index(0))
n, k = map(int, input().split())
if n >= 10:
  return k
else:
  return n + 100 * (10-k)

### FIXED CODE ###

n, k = map(int, input().split())
if n >= 10:
  print(k)
else:
  print(k + 100 * (10-n))
import numpy as np

H, W = map(int, input().split())
A = [np.array(list(map(int, input().split()))).astype("int64") for _ in range(H)]

odds = []
for i in range(H):
    for j in range(W):
        if A[i][j]%2!=0:
            odds.append([i+1, j+1])

diff = []
for k in range(n//2):
    d_x = odds[2*k+1][0]-odds[2*k][0]
    d_y = odds[2*k+1][1]-odds[2*k][1]
    diff.append([d_x, d_y])

odds = np.array(odds)
diff = np.array(diff)

N = sum(sum(diff))

print(N)

for i in range(len(odds)//2):
    j = 0
    k = 0
    temp = odds[2*i]
    if diff[i][0]!=0:
        x_unit = (diff[i]-diff[i][1])//diff[i][0]
        while j<diff[i][0]:
            print(temp[0], temp[1], (temp+x_unit)[0], temp[1])
            temp += x_unit
            j+=1
    if diff[i][1]!=0:
        y_unit = (diff[i]-diff[i][0])//diff[i][1]
        while k<diff[i][1]:
            print(temp[0], temp[1], temp[0], (temp+y_unit)[1])
            temp += y_unit
            k+=1

### FIXED CODE ###

H, W = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(H)]

arr = []
for i in range(H-1):
    for j in range(W):
        if A[i][j]%2!=0:
            A[i+1][j]+=1
            arr.append([i+1, j+1, i+2, j+1])
            
for k in range(W-1):
    if A[H-1][k]%2!=0:
        A[H-1][k+1]+=1
        arr.append([H, k+1, H, k+2])
        
N = len(arr)

print(N)

for i in range(N): 
    print(arr[i][0], arr[i][1], arr[i][2], arr[i][3])
input(x)

y=0

y=x*x*x

print(y)




### FIXED CODE ###

x=input()
x=x*x*x
print(x)
N,K=map(int,input().split())
x=list(map(int,input().split()))
positive=[]
negative=[]
for i in range(N):
    if x[i]<0:
        negative.append(-x[i])
    else:
        positive.append(x[i])
negative.sort()
n=len(negative)
m=len(positive)
ans=1000000000
if n>=K:
    ans=min(ans,negative[K-1])
if m>=K:
    ans=min(ans,positive[K-1])

for i in range(n):
    j=K-(i+1)
    if j<=0:
        continue
    ans=min(ans,negative[i]+positive[j-1]+min(negative[i],positive[j-1]))
print(ans)


### FIXED CODE ###

N,K=map(int,input().split())
x=list(map(int,input().split()))
positive=[]
negative=[]
for i in range(N):
    if x[i]<0:
        negative.append(-x[i])
    else:
        positive.append(x[i])
negative.sort()
n=len(negative)
m=len(positive)
ans=1000000000
if n>=K:
    ans=min(ans,negative[K-1])
if m>=K:
    ans=min(ans,positive[K-1])

for i in range(n):
    j=K-(i+1)
    if j>m:
        continue
    if j<=0:
        continue
    ans=min(ans,negative[i]+positive[j-1]+min(negative[i],positive[j-1]))
print(ans)
print(int(input)*2*3.1415)

### FIXED CODE ###

print(int(input())*2*3.1415)
alfa_map = {"A":0,"B":1,"C":2,"D":3,"E":4,"F":5}
X, Y = map(int,input().split())
if alfa_map[X] > alfa_map[Y]:
  print(">")
elif alfa_map[X] < alfa_map[Y]:
  print("<")
else:
  print("=")

### FIXED CODE ###

alfa_map = {"A":0,"B":1,"C":2,"D":3,"E":4,"F":5}
X, Y = map(str,input().split())
if alfa_map[X] > alfa_map[Y]:
  print(">")
elif alfa_map[X] < alfa_map[Y]:
  print("<")
else:
  print("=")
import sys

def process():
    data = []
    for line in get_data():
        line = line.split()
        if len(line) == 2:
            if line[0] == line[1] == '0':
                data = []
                continue
            H = int(line[0])
            W = int(line[1])
        elif len(line) == 0:
            pass
        else:
            data.append(line[0])
            if len(data) == H:
                field = create_field(H, W)
                print search(H, W, data, field)

def search(H, W, data, field):
    count = 0
    for i in xrange(H):
        for j in xrange(W):
            if field[i][j] == 0:
                continue
            _search(i, j, H, W, data[i][j], data, field)
            count += 1
    return count

def _search(i, j, H, W, cell, data, field):
    field[i][j] = 0
    for a in xrange(i-1, i+2):
        if -1 < a < H:
            pass
        else:
            continue
        for b in xrange(j-1, j+2):
            if -1 < b < W:
                pass
            else:
                continue

            if a != i and b != j:
                continue

            if field[a][b] == 0:
                continue
            if cell == data[a][b]:
                _search(a, b, H, W, cell, data, field)
    return

def create_field(H, W):
    field = []
    for i in xrange(H):
        raw = []
        for j in xrange(W):
            raw.append(1)
        field.append(raw)
    return field

def get_data():
    return [line.strip() for line in sys.stdin.readlines()]

process()

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)


def main():
    solve()


def solve():
    for data in get_dataset():
        print search(data)


def search(data):
    count = 0
    H = len(data)
    W = len(data[0])
    for i in xrange(H):
        for j in xrange(W):
            if data[i][j] == '.':
                continue
            _search(i, j, H, W, data[i][j], data)
            count += 1
    return count


def _search(i, j, H, W, cell, data):
    data[i][j] = '.'
    for a in xrange(i-1, i+2):
        if not -1 < a < H:
            continue
        for b in xrange(j-1, j+2):
            if not -1 < b < W:
                continue

            if a != i and b != j:
                continue

            if data[a][b] == '.':
                continue

            if cell == data[a][b]:
                _search(a, b, H, W, cell, data)
    return


def get_dataset():
    dataset = []
    while True:
        line = raw_input().rstrip().split()
        H = int(line[0])
        if H == 0:
            break

        data = []
        for i in xrange(H):
            data.append(list(raw_input().rstrip()))
        dataset.append(data)
    return dataset


if __name__ == '__main__':
    main()
n,m = map(int,input().split())

print(int(n(n+1)/2 + m(m+1)/2))

### FIXED CODE ###

n,m = map(int,input().split())

print(int(n*(n-1)/2 + m*(m-1)/2))
a,b,c,d = map(int, input())
print(max(a*c,a*d,b*c,b*d))

### FIXED CODE ###

a,b,c,d = map(int, input().split())
print(max(a*c,a*d,b*c,b*d))
a=int(input())
if a < = 999:
  print('ABC')
 else:
  print('ABD')

### FIXED CODE ###

# your code goes here
a=int(input())

if a <= 999:
	print('ABC')
else:
	print('ABD')
N, W = [int(item) for item in input().split()]
item = [[int(item) for item in input().split()] for _ in range(N)]

dp = [0 for _ in range(W+1)]

for i in range(N):
    for w in reversed(range(0, W+1)):
        if dp[w] != 0:
            if w + item[i][0] <= W:
                dp[w + item[i][0]] = max(dp[w +item[i][0]], dp[w] + item[i][1])
        else:
            if w + item[i][0] <= W:
                dp[w + item[i][0]] = dp[w] + item[i][1]
        # print(dp)
print(max(dp[W]))

### FIXED CODE ###

N, W = [int(item) for item in input().split()]
item = [[int(item) for item in input().split()] for _ in range(N)]

dp = [[0 for _ in range(W+1)] for _ in range(N+1)]

for i in range(N):
    for w in range(W+1):
        if 0 <= w - item[i][0]:
            dp[i+1][w] = max(dp[i][w], dp[i][w - item[i][0]] + item[i][1])
        else:
            dp[i+1][w] = dp[i][w]
print(dp[N][W])
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
mod=10**9+7

s=input()+"T"
N=len(s)
x,y=MI()

F=[[],[]]

temp=0
bit=0
for i in range(N):
    if s[i]=="F":
        temp+=1
    else:
        if temp!=0:
            F[bit].append(temp)
        bit=(bit+1)%2
        temp=0
        
Nx=len(F[0])
Ny=len(F[1])

        
#i番目の文字で，位置x [-N~N]につけるかどうか
dpx=[[False]*(2*N+1) for _ in range(Nx+1)]
dpy=[[False]*(2*N+1) for _ in range(Ny+1)]

dpx[0][N]=True
dpy[0][N]=True

if Nx>=1:
    dpx[1][N]=False
    dpx[1][N+F[0][0]]=True
    if s[0]=="T":
        dpx[1][N-F[0][0]]=True

MA=F[0][0]+1

for i in range(1,Nx):
    MA+=F[0][i]
    for j in range(N-MA,N+MA+1):
        if dpx[i][j]:
            jj=j+F[0][i]
            jjj=j-F[0][i]
            if jj<=(2*N):
                dpx[i+1][jj]=True
            if jjj>=0:
                dpx[i+1][jjj]=True
                
if Ny>=1:   
    MA=F[1][0]+1

for i in range(Ny):
    MA+=F[1][i]
    for j in range(N-MA,N+MA+1):
        if dpy[i][j]:
            jj=j+F[1][i]
            jjj=j-F[1][i]
            if jj<=(2*N):
                dpy[i+1][jj]=True
            if jjj>=0:
                dpy[i+1][jjj]=True

if dpx[-1][N+x] and dpy[-1][N+y]:
    print("Yes")
else:
    print("No")





### FIXED CODE ###

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
mod=10**9+7

s=input()+"T"
N=len(s)
x,y=MI()

F=[[],[]]

temp=0
bit=0
for i in range(N):
    if s[i]=="F":
        temp+=1
    else:
        if temp!=0:
            F[bit].append(temp)
        bit=(bit+1)%2
        temp=0
        
XY=[set([0]), set([0])]
    
for bit in range(2):
    for i in range(len(F[bit])):
        temp=set([])
        a=F[bit][i]
        b=-a
        if bit==0 and i==0 and s[0]=="F":
            b=a
        for j in range(len(XY[bit])):
            aaa=XY[bit].pop()
            temp.add(aaa+a)
            temp.add(aaa+b)
        XY[bit]=temp
        
if (x in XY[0] ) and (y in XY[1] ):
    print("Yes")
else:
    print("No")
import sys
from functools import lru_cache

import numpy as np

sys.setrecursionlimit(10000)
INF = float('inf')

H, W = list(map(int, input().split()))
A = [list(input()) for _ in range(H)]

flags = np.zeros((H, W))


# 一番近い # の場所までの数
@lru_cache(maxsize=None)
def count(h, w):
    if not (0 <= h < H and 0 <= w < W and flags[h][w] == 0):
        return INF
    if A[h][w] == '#':
        return 0

    flags[h][w] = 1
    ret = min(
        count(h - 1, w) + 1,
        count(h + 1, w) + 1,
        count(h, w + 1) + 1,
        count(h, w - 1) + 1,
    )
    flags[h][w] = 0
    return ret


ans = -INF
for h in range(H):
    for w in range(W):
        ans = max(ans, count(h, w))
print(ans)


### FIXED CODE ###

import sys
import numpy as np

sys.setrecursionlimit(10000)
INF = float('inf')

H, W = list(map(int, input().split()))
A = np.array([list(input()) for _ in range(H)])

counts = np.zeros((H, W))
counts[A == '.'] = np.inf

for h in range(1, H):
    counts[h, :] = np.minimum(counts[h, :], counts[h - 1, :] + 1)
    counts[-1 - h, :] = np.minimum(counts[-1 - h, :], counts[-h, :] + 1)
for w in range(1, W):
    counts[:, w] = np.minimum(counts[:, w], counts[:, w - 1] + 1)
    counts[:, -1 - w] = np.minimum(counts[:, -1 - w], counts[:, -w] + 1)

print(int(np.max(counts)))
import sys
import numba


S_raw = sys.stdin.readline().strip()

@numba.jit
def check_next(S):
    S = list(S)
    before_num=S[0]
    for i in range(len(S)):
        if S[i]!=before_num:
            S.pop(i-1)
            #S = list(S)
            S.pop(i-1)
            new_S = S
            return S,1
            break
    return S,0


cnt=0
N=0

while cnt<50000:
    S_raw, check_cnt = check_next(S_raw)
    N += check_cnt
    if check_cnt==0:
        break
    cnt+=1
    
print(N*2)

### FIXED CODE ###

S = input()

num0 = S.count("0")
num1 = len(S)-num0

print(min(num0,num1)*2)
N,Y = map(int,input().split())

change = False

for i in range(N+1):
    for j in range(N+1-i):
        if i*10000+j*5000+(N-i-j)*1000==Y:
            print(i,j,N-i-j)
            change = True
            break
else:
    break
            
if change != True:
    print("-1 -1 -1")

### FIXED CODE ###

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

for x in range(N+1):
  for y in range(N+1-x):
    z = N - x - y
    if 10000*x+5000*y+1000*z == Y:
        print(x,y,z)
        exit()
print(-1,-1,-1)
H, W = map(int, input().split())
S = [list(map(int, input().split())) for i in range(H)]
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

for i in range(H):
  for j in range(W):
    if s[i][j] == '.':
      cnt = 0
      for n in range(8):
        ni = i + dx[n]
        nj = j + dy[n]
        if ni < 0 or ni >= H:
          continue
        if nj < 0 or nj >= W:
          continue
        if s[ni][nj] == '#':
          cnt += 1
      S[i][j] = str(cnt)

print(S)
    


### FIXED CODE ###

H, W = map(int, input().split())
S = []
for i in range(H):
    S.append(list(input()))
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

for i in range(H):
  for j in range(W):
    if S[i][j] == '#':
      continue
    cnt = 0
    for n in range(8):
      ni = i + dx[n]
      nj = j + dy[n]
      if ni < 0 or H <= ni or nj < 0 or W <= nj:
        continue
      if S[ni][nj] == '#':
        cnt += 1
    S[i][j] = str(cnt)


    
for i in range(H):
    print("".join(S[i]))
input_line=input().rstrip().split(" ")
a=int(input_line[0])
b=int(input_line[1])
c=int(input_line[2])
if a+b+c!=17:
    print("NO")
elif (a==b==5 or a==c==5 or b==C==5) and a+b+c==17:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

input_line=input().rstrip().split(" ")
five=int(input_line.count("5"))
seven=int(input_line.count("7"))
if five==2 and seven==1:
    print("YES")
else:
    print("NO")