Problem:
 Score : 200 points    Problem Statement Find the number of palindromic numbers among the integers between A and B (inclusive).
Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.      Constraints  10000 \leq A \leq B \leq 99999  All input values are integers.         Input Input is given from Standard Input in the following format:  A  B       Output Print the number of palindromic numbers among the integers between A and B (inclusive).        Sample Input 1 11009 11332      Sample Output 1 4  There are four integers that satisfy the conditions: 11011 , 11111 , 11211 and 11311 .       Sample Input 2 31415 92653      Sample Output 2 612

Solution (Python):
class Solution:
    def solve(self, A: int, B: int) -> int:

        answer = 0

        for n in range(A, B+1):
            if str(n) == "".join(reversed(str(n))):
                answer += 1

        return answer


if __name__ == '__main__':

    
    A, B = map(int, input().split())

    
    solution = Solution()
    print(solution.solve(A, B))

Solution (Python):
A, B = map(int, input().split())


def reverseDigits(n):
  reversed = 0
  while n > 0:
    q, mod = divmod(n, 10)
    reversed = reversed * 10 + mod
    n = q
  return reversed

counter = 0
for i in range(A, B + 1):
  if i == reverseDigits(i):
    counter += 1

print(counter)

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
  if i % 10 == (i//10000)%10 and (i//10)%10 == (i//1000)%10:
    ans += 1
print(ans)

Solution (Python):
a,b = map(int, input().split())

ans = 0
for i in range(a,b+1):
  if str(i) == str(i)[::-1]:
    ans += 1
print(ans)

Solution (Python):
a,b = map(int,input().split())

ans = 0
for i in range(a,b+1):
    s = str(i)
    if s[0] == s[4] and s[1] == s[3]:
        ans += 1

print(ans)

Solution (Python):
def check_palindrome(i):
    a = str(i)
    return a == a[::-1]

a, b = [int(e) for e in input().split()]
count = 0
for i in range(a, b+1):
    if check_palindrome(i):
        count += 1
print(count)

Solution (Python):
A,B=map(int,input().split())
count=0
for i in range(A,B+1):
    a=str(i)
    if a[0]==a[4] and a[1]==a[3]:
        count+=1
print(count)

Solution (Python):
a,b=map(int,input().split())
ans =0
for i in range(a,b+1):
    j=str(i)
    if j[0]==j[4] and j[1]==j[3]:
        ans+=1
print(ans)

Solution (Python):
a, b = map(int, input().split())
result = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        result += 1
print(result)

Solution (Python):
a,b = map(int, input().split())
count = 0
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            if a <= i*10000 + j*1000 + k*100 + j*10 + i <= b:
                count += 1
print(count)

Solution (Python):
a, b = map(int, input().split())
num = a
ans = 0
while num <= b:
    str_num = str(num)
    if str_num[0] == str_num[4] and str_num[1] == str_num[3]:
        ans += 1
    num += 1
print(ans)

Solution (Python):
A, B = map(int, input().split())
cnt = 0
for i in range(A, B+1):
    flag = True
    chr_i = str(i)
    re_chr_i = chr_i[::-1]
    for j in range(len(chr_i)):
        if chr_i[j]!=re_chr_i[j]:
            flag = False
            break
    if flag:
        cnt += 1
print(cnt)

Solution (Python):
a,b = map(int,input().split())
cnt = 0
for i in range(a,b+1):
    if str(i) == str(i)[::-1]:
        cnt += 1
print(cnt)

Solution (Python):
a, b = map(int, input().split())

count = 0
for i in range(a, b+1):
    i = str(i)
    if i[0] == i[4] and i[1] == i[3]:
        count += 1

print(count)

Solution (Python):
A, B = map(int,input().split())

ans=0
for i in range(A,B+1):
  if str(i) == str(i)[::-1]:
    ans += 1
print(ans)

Solution (Python):
ans=0
a,b=map(int,input().split())
for i in range(a,b+1):
    g=str(i)
    if g==g[::-1]:
        ans+=1
print(ans)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        ans += 1

print(ans)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    d=list(str(i))
    dl=len(d)
    
    c=0
    for j in range(dl//2):
       
        if d[j]==d[dl-1-j]:
            c+=1
    if c==dl//2:
        ans+=1
print(ans)

Solution (Python):
a, b = map(int, input().split())
t = 0
for i in range(a, b+1):
    A = list(str(i))
    if A == list(reversed(A)):
        t += 1
print(t)

Solution (Python):
A,B = map(int, input().split())

ans = 0
for _ in range(A,B+1):
  str_ = str(_)
  if str_[0] == str_[4]:
    if str_[1] == str_[3]:
      ans += 1
      
print(ans)

Solution (Python):
a, b = list(map(int, input().split(' ')))

count = 0
for i in range(a, b + 1):
    s = str(i)
    t = list(s)
    t.reverse()
    t = ''.join(t)
    if s == t:
        count += 1

print(count)

Solution (Python):
a, b = map(int, input().split())
print(len([i for i in range(a, b+1) if str(i) == "".join(list(reversed(str(i))))]))

Solution (Python):
A, B = [int(n) for n in input().split()]
total = 0
for n in range(A, B+1):
  s = str(n)
  if s == s[::-1]:
    total += 1
print(total)

Solution (Python):
A, B = [int(i) for i in input().split()]

cnt = 0
for n in range(A, B+1):
    n = str(n)
    if n == n[::-1]:
        cnt += 1
        
print(cnt)

Solution (Python):
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    s = str(i)
    len_s = len(s)
    for j in range(int(len_s / 2)):
        if s[j] != s[len_s - j - 1] :
            break
        if j == int(len_s / 2) - 1 :
            ans += 1
print(ans)

Solution (Python):
A,B = map(int,input().split())


ans = 0
for i in range(A,B+1):
  num = list(map(int,list(str(i))))
  if num[0]==num[4] and num[1]==num[3]:
    ans += 1


    
print(ans)

Solution (Python):
def is_palindrome(s: str) -> bool:
    return s[:len(s)//2] == s[-1*(len(s)//2):][::-1]


a, b = [int(i) for i in input().split()]
print([is_palindrome(str(n)) for n in range(a, b+1)].count(True))

Solution (Python):

def is_palindrome(s: str) -> bool:
    return s[:len(s)//2] == "".join(list(reversed(s[-1*(len(s)//2):])))


a, b = [int(i) for i in input().split()]
print([is_palindrome(str(n)) for n in range(a, b+1)].count(True))

Solution (Python):
A, B = map(int,input().split())
ans = 0
for i in range(A, B+1):
  str_i = str(i)
  if str_i[0] == str_i[4] and str_i[1] == str_i[3]:
    ans += 1
  else:
    continue

print(ans)

Solution (Python):
A, B = map(int, input().strip().split(' '))

result = 0
for i in range(A, B + 1):
  s = i % 10
  t = i // 10000 % 10
  u = i // 10 % 10
  v = i // 1000 % 10
  if s == t and u == v:
    result += 1
print(result)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    i_s=str(i)
    i_r=i_s[::-1]
    if i_s==i_r:
        ans+=1
print(ans)

Solution (Python):
def func(X,A,B):
    count = 0
    for i in range(X,100):
        j = str(i)
        z = j[1]+j[0]
        for y in range(10):
            tmp = int(str(i)+str(y)+z)
            if A <= tmp and tmp <= B:
                count += 1
            elif tmp > B:
                return count
    return count
a,b = input().split()
x = a[:2]
A = int(a)
B = int(b)
X = int(x)
print(func(X,A,B))

Solution (Python):
a, b = map(int, input().split())
cnt = 0
for num in range(a, b + 1):
    if str(num) == str(num)[::-1]:
        cnt += 1
    else:
        continue
print(cnt)

Solution (Python):
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    if str(i) == str(i)[::-1]:
        ans += 1
print(ans)

Solution (Python):
a, b = map(int, input().split())
ans = 0

for i in range(a, b + 1):
    val = str(i)
    if (val[0] == val[4] and val[1] == val[3]):
        ans += 1

print(ans)

Solution (Python):
a, b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    val = str(i)
    if val[0] == val[4] and val[1] == val[3]:
        ans += 1
print(ans)

Solution (Python):
a,b = map(int, input().split())
l = [str(_) for _ in range(a,b+1)]
x = 0
for i in range(b-a+1):
    y = int(len(l[i])/2)
    if l[i][:y] == l[i][-1:-(y+1):-1]:
        x += 1
print(x)

Solution (Python):



def check(num):
    n=num
    digit_list=[]
    
    while num != 0:
        digit_list += [num % 10]
        num //= 10
    
    for i in range( len(digit_list) // 2 + 1*(len(digit_list)%2) ):
        if digit_list[i] != digit_list[len(digit_list)-1-i]:
            return False
    
    return True


a,b = list(map(int, input().rstrip().split()))

count=0
for i in range(a,b+1):
    if check(i):
        count += 1

print(count)

Solution (Python):
a, b = map(int, input().split())

ans = 0
for n in range(a, b+1):
    s = str(n)
    if (s[0] == s[-1]) and (s[1] == s[-2]):
        ans += 1
print(ans)

Solution (Python):
A,B=map(int,input().split())

def make(n):
    S=str(n)
    n2=int(S[::-1])
    return n2

ans=0
for i in range(A,B+1):
    if i==make(i):
        ans+=1
    
print(ans)

Solution (Python):
a, b = map(int, input().split())
count = 0

for i in range(a, b+1):
  if str(i)[0:2] == str(i)[:-3:-1]:
    count += 1
    
print(count)

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    a, b = map(int, input().split())
    ans = 0
    for n in range(a, b+1):
        if list(str(n)) == list(reversed(str(n))):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
A,B=map(int,input().split())
cnt=0
for i in range(A,B+1):
    if str(i)[:3]==str(i)[:-4:-1]:cnt+=1
print(cnt)

Solution (Python):
A, B = map(int, input().split())

def kaibun(num) :
    num_str = str(num)
    for i in range((len(num_str)+1)//2) :
        if num_str[i] != num_str[-(i+1)] :
            return False
    return True

ans = 0

for i in range(A,B+1) :
    if kaibun(i) == True :
        ans += 1

print(ans)

Solution (Python):
[A, B] = list(map(int, input().split()))
count = 0
for i in range(A, B+1):
  I = str(i)
  if I[0] == I[4] and I[1] == I[3]:
    count += 1
    
print(count)

Solution (Python):
A, B = [int(x) for x in input().split(" ")]

cnt = 0

for i in range(A,B+1):
    lis = list(str(i))
    for j in range(0,len(lis)):
        if j == len(lis)-1:
            cnt += 1
        elif lis[j] != lis[(-1-j)]:
            break
        
print(cnt)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
    x = i % 100
    y = i // 1000
    if x % 10 == y // 10 and x // 10 == y % 10:
        ans += 1
print(ans)

Solution (Python):
a, b = map(int, input().split())
c = 0

for i in range(a, b+1):
    j = str(i)
    if j[0] == j[4] and j[1] == j[3]:
        c += 1

print(c)

Solution (Python):
A, B = map(int, input().split())
answer = 0
for n in range(A, B+1):
    if str(n)[0] == str(n)[-1] and str(n)[1] == str(n)[-2]:
        answer += 1

print(answer)

Solution (Python):
a,b=map(int,input().split())

def is_pali(s):
    if s==s[::-1]: return True
    else: return False
  
  
cnt=0  
for i in range(a,b+1):
    if is_pali(str(i))==True: cnt+=1
print(cnt)

Solution (Python):
def main():
    lower_limit, upper_limit = map(int, input().split(" "))
    answer = 0
    for i in range(lower_limit, upper_limit + 1):
        num = str(i)
        if num[0] == num[-1] and num[1] == num[-2] and num[2] == num[-3]:
            answer += 1
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    t=i 
    if str(t)==str(t)[::-1]:
        ans+=1
print(ans)

Solution (Python):
A,B=map(int,input().split())
answer=0
for N in range(B-A+1):
  k=0
  for i in range(len(str(A+N))//2):
    if str(A+N)[i]==str(A+N)[-(i+1)]:
      k+=1
      if k==(len(str(A+N))//2):
        answer+=1
print(answer)

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
    if i % 10 == i // 10000 and i // 10 % 10 == i // 1000 % 10:
        count += 1
print(count)

Solution (Python):
A, B = map(int, input().split())
I = 0
num = 0
for i in range (A,B+1):
  I = str(i)
  if I[1]==I[-2] and I[0]==I[-1]:
    num += 1
print(num)

Solution (Python):




def main():
    A, B = map(int, input().split())
    result = 0
    for i in range(A, B + 1):
        i = str(i)
        if i[::] == i[::-1]:
            result += 1
    print(result)


if __name__ == "__main__":
    main()

Solution (Python):
try:
    A, B = map(int, input().split())
    B_ = [i for i in range(B+1)] 
    A_ = [j for j in range(A)]
    res = list(set(B_)-set(A_))
    cnt = 0
    for re in res:
        if str(re) == str(re)[::-1]:
            cnt += 1
    print(cnt)
except EOFError:
    pass

Solution (Python):
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):
	if all(str(i)[j]==str(i)[-1-j] for j in range(len(str(i))//2)):
		cnt += 1
	else:
		pass
print(cnt)

Solution (Python):
a, b = [int(x) for x in input().split()]

cnt = 0
for i in range(a, b + 1):
    fl = 0
    s = str(i)
    for j in range(len(s)//2):
        if not s[j] == s[len(s)-1-j]:
            fl = 1
            break
    if fl == 0:
            cnt += 1
print(cnt)

Solution (Python):
A, B = map(int, input().split())
ans = 0
for num in range(A,B+1,1):
    target = str(num)
    index, _ = divmod(len(target),2)
    count = 0

    for i in range(index):
        if target[i] == target[-i-1]:
            count += 1
            if count == index:
                ans += 1

print(ans)

Solution (Python):
s, t = map(int, raw_input().split())
ans = 0
for a in range(s, t + 1):
    a = str(a)
    flag = 0
    for i in range(len(a)):
        if a[i] != a[len(a) - 1 - i]:
            flag = 1
            break
    if flag == 0:
        ans += 1
print ans

Solution (Python):
def count(n):
	N = []
	while n > 0:
		N.append(n % 10)
		n = n // 10

	if N[0] == N[4] and N[1] == N[3]:
		return 1
	else:
		return 0

A, B= map(int,input().split())
ans = 0

for i in range(A, B + 1):
	if count(i) == 1:
		ans += 1


print(int(ans))

Solution (Python):
a, b = map(int, input().split())

ans = 0
for i in range(a, b + 1):
  for j in range(len(str(i))):
    if str(i)[j] != str(i)[(-1) * j - 1]:
      break
  else:
    ans += 1
print(ans)

Solution (Python):
a,b=map(int,input().split())
c=0
for x in range(1,10):
    for y in range(0,10):
        for z in range(0,10):
            i=10000*x+1000*y+100*z+10*y+x
            if a<=i<=b:
                c+=1
print(c)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
    if str(i)[::-1] == str(i):
        ans += 1
print(ans)

Solution (Python):
a, b = map(int, input().split())
cnt = 0
for i in range(a, b+1):
    si = str(i)
    if si[0] == si[4] and si[1] == si[3]:
        cnt += 1
print(cnt)

Solution (Python):
a, b = map(int, input().split())

ans = 0
for i in range(a, b+1):
    s = str(i)
    if s[0] == s[4] and s[1] == s[3]:
        ans += 1

print(ans)

Solution (Python):
a, b = map(int, input().split())

ans = 0
for i in range(a, b+1):
    if str(i)[0] == str(i)[4] and str(i)[1] == str(i)[3]:
        ans += 1

print(ans)

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
  s = list(str(i))
  if s == s[::-1]:
    ans += 1
print(ans)

Solution (Python):
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    digit_1 = i % 10
    digit_2 = (i % 100)//10
    digit_4 = (i % 10000)//1000
    digit_5 = i//10000
    if digit_1 == digit_5 and digit_2 == digit_4:
        ans += 1
        
print(ans)

Solution (Python):
a,b=map(int,input().split())

ans=0

for i in range(a,b+1):
    buf=str(i)
    str1=buf[::-1]
    if buf==str1:
        ans+=1

print(ans)

Solution (Python):
a,b=map(int,input().split())

ans=0

for i in range(a,b+1):
    buf=str(i)
    
    str1=buf[0:int(len(buf)/2)]
    str2=buf[int(len(buf)/2+1):]
    if str1[0]==str2[1] and str1[1]==str2[0]:
        ans+=1

print(ans)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for k in range(a, b + 1):
    s = str(k)
    if s == s[::-1]:
        ans += 1
print(ans)

Solution (Python):
A,B = map(int,input().split())

count = 0
for i in range(A,B+1):
    i = str(i)
    if (i[0]==i[-1])and(i[1]==i[-2]):
        count += 1
print(count)

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    y = str(i)
    x = y[::-1]
    if y == x:
        ans += 1
print(ans)

Solution (Python):
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
  s=str(i)
  t=s[::-1]
  c+=s==t
print(c)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  if str(i)==str(i)[::-1]:
    ans+=1
print(ans)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b=INTM()
    ct=0
    for i in range(a,b+1):
        s=str(i)
        if s[0]==s[4] and s[1]==s[3]:
            ct+=1
    print(ct)
if __name__ == '__main__':
    do()

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
    num = str(i)
    if len(num) % 2 == 1:
        if num[:len(num)//2] == num[len(num)//2+1:][::-1]:
            count += 1
            continue
    else:
        if num[:len(num)/2] == num[len(num)/2+1:][::-1]:
            count += 1
            continue
print(count)

Solution (Python):
a,b = map(str, input().split())
cnt = 0
for i  in range(int(a), int(b)+1):
    if str(i) == str(i)[::-1]:
        cnt += 1
print(cnt)

Solution (Python):

A, B = map(int,input().split())
k = B - A + 1
n = 0
for i in range(k):
    if str(A+i)[0] == str(A+i)[4] and str(A+i)[1] == str(A+i)[3]:
        n += 1
print(n)

Solution (Python):
A,B = map(int,input().split())
ans = 0
for i in range(A,B+1):
    s = str(i)
    t = ""
    for j in range(len(s)):
        t += s[len(s)-1-j]
    if s==t:
        ans += 1
print(ans)

Solution (Python):
a,b = map(int, input().split())
count = 0
for i in range(a,b+1):
    n = list(str(i))
    if n[0] == n[-1] and n[1] == n[-2]:
        count += 1
print(count)

Solution (Python):
a, b = map(int, input().split())
cnt = 0

for i in range(a, b+1):
    s = str(i)
    if(s == s[::-1]):
        cnt += 1
print(cnt)

Solution (Python):

a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    i=str(i)
    if i[0]==i[4] and i[1]==i[3]:
        ans+=1

print(ans)

Solution (Python):
a, b = map(int, input().split())

ans = 0
for i in range(a, b + 1):
    s = str(i)
    if s[0] == s[4]:
        if s[1] == s[3]:
            ans += 1
print(ans)

Solution (Python):

def check(v):
    vs = str(v)
    length = len(vs)
    if length % 2 != 0:
        if vs[:length//2] == vs[length//2+1:][::-1]:
            return True
        else:
            return False
    else:
        if vs[:length//2] == vs[length//2:][::-1]:
            return True
        else:
            return False
A, B = map(int, input().split())
ans = 0
for v in range(A, B+1):
    
    
    
    
    
    if check(v):
        
        ans += 1
print(ans)

Solution (Python):

A,B=map(int,input().split())
cnt=0

for i in range(A,B+1):
    si=str(i)
    flg=True
    for j in range(len(si)//2):
        if si[j]!=si[-(j+1)]:
            flg=False
    
    if flg:
        cnt+=1
        
print(cnt)

Solution (Python):
a,b=map(int,input().split())
count=0

for i in range(a,b+1):
	val=str(i)
	if (val[0]==val[-1]) and (val[1]==val[-2]):
		count+=1

print(count)

Solution (Python):
A, B = map(int, input().split())

count = 0
for i in range(A, B+1):
    n = list(str(i))
    _n = n[::-1]
    if n == _n:
        count += 1

print(count)

Solution (Python):
a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
  l = list(str(i))
  if l == l[::-1]:
    count += 1
print(count)

Solution (Python):
A,B = list(map(int,input().split()))

ans = 0
for i in range(A,B+1):
    s = list(str(i))
    if s[0] == s[4] and s[1] == s[3]:
        ans+=1

print(ans)

Solution (Python):
A,B=map(int,input().split())
s=""
count=0
for i in range(A,B+1):
    s=str(i)
    if (s[0]==s[4])and(s[1]==s[3]):
        count=count+1

print(count)

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        count += 1
print(count)

Solution (Python):
import math


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




tot = 0
count = 0

for i in range(a, b+1):
  n_str = list(str(i))
  integ  = [int(s) for s in n_str]
  integ_rev = integ[::-1]
  if (integ == integ_rev):
    count = count + 1

print(count)

Solution (Python):
a,b=map(int,input().split())
print(sum(i==i[::-1] for i in map(str,range(a,b+1))))

Solution (Python):
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys




read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A, B = map(int, readline().split())

ans = 0
for i in range(A, B + 1):
    M = str(i)
    if M == M[::-1]:
        ans += 1
print(ans)

Solution (Python):
def Is_cyc(x):
  s = str(x)
  for i in range(len(s)):
    if s[i] != s[-i-1]:
      return False
  return True

def main():
  a,b = map(int,input().split())
  ans = 0
  for i in range(a,b+1):
    if Is_cyc(i):
      ans += 1
  print(ans)
  return

if __name__ == "__main__":
  main()

Solution (Python):
def solve(a, b):
    f = lambda x, i: int(str(x)[i])
    fl1, fr1 = (f(a, 0), f(b, 0))
    fl2, fr2 = (f(a, 1), f(b, 1)) if fl1 == fr1 else (0, 9)
    fl3, fr3 = (f(a, 2), f(b, 2)) if fl2 == fr2 else (0, 9)
    return sum(
        a <= int('{0}{1}{2}{1}{0}'.format(i, j, k)) <= b
        for i in range(fl1, fr1 + 1)
        for j in range(fl2, fr2 + 1)
        for k in range(fl3, fr3 + 1)
    )

_a, _b = map(int, input().split())
print(solve(_a, _b))

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
  if str(i) == str(i)[::-1]:
    ans+=1
print(ans)

Solution (Python):
a,b = map(int,input().split())
cnt = 0
for i in range(b-a+1):
    c = str(a+i)
    if c[0]==c[4] and c[1]==c[3]:
        cnt += 1
print(cnt)

Solution (Python):
A, B = [int(i) for i in input().rstrip().split(' ')]
cnt = 0
for i in range(A, B+1):
    arr = [i for i in list(str(i))]
    if not arr[0] == arr[-1]:
        continue
    
    asc = ''.join(arr)
    desc = ''.join(list(reversed(arr)))
    if asc == desc:
        cnt += 1

print(cnt)

Solution (Python):
def sumNum(num, sums):
    if num == 0:
        return sums
    sums += num % 10
    num = num // 10
    return sumNum(num, sums)

A, B = [int(i) for i in input().rstrip().split(' ')]
cnt = 0
for i in range(A, B+1):
    arr = [i for i in list(str(i))]
    if not arr[0] == arr[-1]:
        continue
    
    asc = ''.join(arr)
    desc = ''.join(list(reversed(arr)))
    if asc == desc:
        cnt += 1

print(cnt)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    s=str(i)
    if s[0]==s[4] and s[1]==s[3]:
        ans+=1
print(ans)

Solution (Python):
A, B = map(int, input().split())
count=0
for i in range(B-A+1):
    if str(A+i)==str(A+i)[::-1]:
        count+=1
print(count)

Solution (Python):
A, B = map(int, input().split())
I = 0
num = 0
for i in range (A,B+1):
  I = str(i)
  if I[1]==I[-2] and I[0]==I[-1]:
    num += 1
print(num)

Solution (Python):
A, B = map(int, input().split())
count=0
for i in range(B-A+1):
    if str(A+i) == str(A+i)[::-1]:
        count+=1
print(count)

Solution (Python):
A, B = map(int, input().split())
cnt = 0
for i in range(A, B+1):
    if str(i)==str(i)[::-1]:
        cnt += 1
print(cnt)

Solution (Python):
a,b = map(int,input().split())

count = 0
for i in range(a, b + 1):
    c = 0
    n = str(i)
    for j in range(len(n)):
        if n[j] == n[-1-j]:
            c += 1
        
    if c == len(n):
        count += 1
print(count)

Solution (Python):
A,B = map(int,input().split())
ans = 0
for x in range(A,B+1):
    if int(str(x)[::-1]) == x:
        ans += 1
print(ans)

Solution (Python):

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

ans = 0
for i in range(a, b + 1):
    tmp = str(i)
    if tmp[0] == tmp[4] and tmp[1] == tmp[3]:
        ans += 1
print(ans)

Solution (Python):
def is_palindrome(n):
    n = str(n)
    return n == n[::-1]


A, B = map(int, input().split())

ans = sum([1 for x in range(A, B + 1) if is_palindrome(x)])

print(ans)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    s=str(i)
    if s == s[::-1]:
        ans+=1
print(ans)

Solution (Python):
a,b = map(int, input().split())
ans = 0
for i in range(a,b+1):
    i = str(i)
    if (i[0] == i[4]) and (i[1] == i[3]):
        ans += 1

print(ans)

Solution (Python):
a,b = map(int,input().split())

ans = 0

for i in range(a,b+1):
    s = str(i)
    if len(s) %2== 1:
        c = s[:len(s)//2]
        d = s[len(s)-1:len(s)//2:-1]
        if c == d:
            ans += 1
    else:
        c = s[:len(s)//2]
        d = s[len(s)-1:len(s)//2:-1]
        if c == d:
            ans += 1

print(ans)

Solution (Python):
A,B = map(int,input().split())

ans = 0

for i in range(A,B+1):
    a = str(i)
    if a[0]==a[4] and a[1]==a[3]:
        ans +=1
print(ans)

Solution (Python):
a,b = map(int,input().split())
i=a
num=0
while a<=i<=b:
    j = str(i)
    if j==j[::-1]:
        num+=1
    i+=1
print(num)

Solution (Python):
a,b = map(int,input().split())
i=a
num=0
while a<=i<=b:
    j = str(i)
    if j==j[::-1]:
        num+=1
    i+=1
print(num)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  if all([str(i)[j]==str(i)[-1-j] for j in range(len(str(i))//2)]):
    ans += 1
print(ans)

Solution (Python):
a,b = map(int, input().split())

cnt = 0
for i in range(a, b+1):
    if str(i)==str(i)[::-1]:
        cnt += 1
print(cnt)

Solution (Python):
A, B = map(int, input().split());print(sum(str(i)==str(i)[::-1]for i in range(A,B+1)))

Solution (Python):
a,s=map(int,input().split())
ad=0
for i in range(a,s+1):
  if str(i)==str(i)[::-1]:ad+=1
print(ad)

Solution (Python):
a, b = list(map(int, input().split()))

n = 0

for i in range(a, b + 1):
  if int(str(i)[::-1]) == i:
    n += 1
    
print(n)

Solution (Python):
A, B = map(int,input().split())

ans = 0
for i in range(A, B + 1):
  if i == int(str(i)[::-1]):
    ans += 1

print(ans)

Solution (Python):
a, b = input().split()

result = 0
for i in range(int(a),int(b)+1):
  s = str(i)
  if s[0]+s[1] == s[4]+s[3]:
    result += 1

print(result)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    rev_i=''.join(list(reversed(list(str(i)))))
    if(str(i)==rev_i):
        ans+=1
print(ans)

Solution (Python):


import numpy as np

a,b=map(int,input().split())
ans=0

def check(x):
    s=str(x)
    return s==s[::-1]

for i in range(a,b+1):
    if(check(i)):ans+=1
print(ans)

Solution (Python):


import numpy as np

a,b=map(int,input().split())
ans=0

def check(x):
    s=str(x)
    for i in range(len(s)):
        if(s[i]!=s[len(s)-1-i]):return False
    return True

for i in range(a,b+1):
    if(check(i)):ans+=1
print(ans)

Solution (Python):
a, b = map(int, input().split())

count =0
for i in range(a, b+1):
    s1 = str(i)
    if s1==s1[::-1]:
        count += 1

print(count)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
    l, rl = list(str(i)), list(reversed(str(i)))
    if l == rl:
        ans += 1

print(ans)

Solution (Python):
A, B = map(int, input().split())

def check_palindromic(i):
  if i[0] == i[-1] and i[1] == i[-2]:
    return True
  else:
    return False

count = 0
for i in range(A, B + 1):
  if check_palindromic(str(i)):
    count += 1
print(count)

Solution (Python):
A, B = map(int, input().split())

ans = []
for n in range(A, B+1):
    s = str(n)
    if s == s[::-1]:
        ans.append(s)
print(len(ans))

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  s=str(i)
  if s[0]==s[4] and s[1]==s[3]:
    ans+=1
print(ans)

Solution (Python):
A, B = map(int, input().split())
ans = 0
for i in range(100,999+1):
  Pal = str(i)
  Pal += Pal[1]+Pal[0]
  Palans = int(Pal)
  if A<=Palans<=B:
    ans+=1
print(ans)

Solution (Python):
A, B = map(int, input().split())

ans = 0
for i in range(A, B+1):
    i = str(i)
    former = i[:2]
    latter = i[3:]
    if (int(former) % 11 == 0 and former == latter) or former == latter[::-1]:
        ans += 1
print(ans)

Solution (Python):
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
  if str(i)[0]==str(i)[-1] and str(i)[1]==str(i)[-2]:
    count+=1
  else:
    pass
  i+=1
print(count)

Solution (Python):
A, B = map(int, input().split())

ansArray = []
i_str = ''
for i in range(B+1):
  i_str = str(i)
  i_str_zfilled = i_str.zfill(5)
  if i_str_zfilled[0] == i_str_zfilled[4] and i_str_zfilled[1] == i_str_zfilled[3]:
    ansArray.append(i)

count = 0
for ans in ansArray:
  if A <= ans <= B:
    count += 1

print(count)

Solution (Python):
l = [int(i) for i in input().split()]

ln = []
c = 0

for i in range(l[0],l[1]+1):
  ln.append(i)
  

def palin(a):
  if a == a[::-1]:
    return 1
  else:
    return 0

  
for i in range(len(ln)):
  c += int(palin(str(ln[i])))
  
print(c)

Solution (Python):
a, b = map(int, input().split())

count = 0
for i in range(a, b+1):
   s = str(i)
   if (s[0]==s[-1] and s[1]==s[-2]):
      count += 1
print(count)

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
  if str(i) == str(i)[::-1]:
    count += 1
print(count)

Solution (Python):
A, B = map(int, input().split())
ans = 0
for i in range(A, B + 1):
    if(str(i) == str(i)[::-1]): ans += 1
print(ans)

Solution (Python):
a, b = map(int,input().split())
ans = 0

for i in map(str,range(a,b+1)):
  if i == i[::-1]:
    ans +=1
  else:
    continue
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
A,B = [int(i) for i in input().split()]
count = 0
for i in range(A,B+1) :
    S = str(i)
    if S[0] == S[-1] and S[1] == S[3] :
        count+=1
print(count)

Solution (Python):

a, b = map(int, input().split())
count = 0

for i in range(a, b+1):
    num = str(i)
    
    
    if num[0] == num[1] and num[0] == num[3] and num[0] == num[4]:
        count += 1
    
    elif num[0] == num[4] and num[1] == num[3]:
        count += 1

print(count)

Solution (Python):
A, B = map(int, input().split())

ans = 0
for i in range(A, B + 1):
  if str(i)[0] == str(i)[-1] and str(i)[1] == str(i)[-2]:
    ans += 1
  
print(ans)

Solution (Python):
a,b = map(int,input().split())

ans = 0
for i in range(a, b+1):
    s = str(i)
    if s[0] == s[-1] and s[1] == s[-2]:
        ans += 1

print(ans)

Solution (Python):
a, b = map(int, input().split())

count = 0

for i in range(a, b+1):
    if str(i)[::] == str(i)[::-1]:
        count += 1

print(count)

Solution (Python):
x,y = map(int,input().split())
count = 0

for i in range(x, y + 1):
  t = str(i)
  if t[0] == t[-1] and t[1] == t[-2]:
    count += 1

print(count)

Solution (Python):
a, b = map(int, input().split())

cont = 0

for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        cont +=1
        
print(cont)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for i in range(a, b+1):
  if (str(i)[0] == str(i)[-1]) and (str(i)[1] == str(i)[-2]):
    ans += 1

print(ans)

Solution (Python):
a, b = map(int, input().split())
count = 0
for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        count += 1

print(count)

Solution (Python):
A, B = map(int,input().split())


count=0
for i in range(A, B+1):
    I = str(i)
    
    if I[0]==I[4] and I[1]==I[3]:
        count += 1

print(count)

Solution (Python):
A,B = map(int, input().split())
cnt = 0

for i in range(A, B+1):
	if str(i) == str(i)[::-1]:
		cnt+=1
		
print(cnt)

Solution (Python):
a, b = map(int, input().split())

cnt = 0

for i in range(a, b+1):
    if str(i) == str(i)[::-1]:
        cnt += 1
print(cnt)