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):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7


a,b=MI()
def kaibunn(n):
    u=str(n)
    if u[0]==u[4] and u[1]==u[3]:
        return 1
    else:
        return 0
ans=0
for i in range(a,b+1):
    ans+=kaibunn(i)
print(ans)

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

count = 0
for i in range(A, B+1):
    num = list(str(i))
    num_r = []
    for i in range(len(num)):
        num_r.append(num[-(i+1)])
    if num == num_r:
        count += 1
    else:
        continue

print(count)

Solution (Python):
a,b = map(int,input().split())
count = 0
for i in range(a,b+1):
    moji = str(i)
    flag = True
    for j in range(1,len(moji)//2+1):
        if moji[j-1]!=moji[-j]:
            flag = False
            break
    if flag:
        count += 1
print(count)

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

for i in range(a, b+1):
    if i//10000 == i%10:
        if i%10000//1000 == i%100//10:
            count +=1
            
print(count)

Solution (Python):
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time
from fractions import gcd



def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


show_flg = False



def main():
    A, B = MI()
    ans = 0

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

    print(ans)


if __name__ == '__main__':
    main()

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

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

print(c)

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

print(cnt)

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

for i in range(a,b+1):
  j1 = str(i)
  j2 = ''.join(list(reversed(j1)))
  if j1 == j2:
    ans += 1

print(ans)

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

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

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

print(count)

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

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())
count = 0
for i in range(A,B+1):
  if str(i)[0] == str(i)[4] and str(i)[1] == str(i)[3]:
    count += 1
print(count)

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):
    S = str(i)
    n = len(S)
    if n%2 == 0:
        m = n//2
        x = S[:m]
        y = S[m:]
    else:
        m = n//2
        x = S[:m]
        y = S[m+1:][::-1]
    if x == y:
        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 == s[::-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):
a,b = map(int,input().split())
ans= 0
for i in range(a,b+1):
  ans += str(i)==str(i)[::-1]
print(ans)

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

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

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

Solution (Python):

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

Solution (Python):


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

def isPalindrome(s):
    if s[0]==s[4] and s[1]==s[3]:
        return True
    return False

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

Solution (Python):
import numpy as np
import sys

input = sys.stdin.readline

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


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

print(res)

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())
m=0
for i in range(A, B+1):
  if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[3]:
    m+=1
print(m)

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):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
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):
    i = str(i)
    if i[0] == i[4] and i[1] == i[3]:
        cnt += 1
        
print(cnt)

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

cnt = 0
for n in range(a, b+1):
    sn = str(n)
    if sn == sn[::-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)
    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):
  k = str(i)
  if k[0] == k[4] and k[1] == k[3]:
    count += 1
print(count)

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

    ans = 0
    for i in range(a, b+1):
        tmp = str(i)
        if tmp == tmp[::-1]:
            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):
    c = str(i)[::-1]
    if str(i) == c:
        cnt+=1
print(cnt)

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

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

Solution (Python):




a, b = input().split()


va = int(a)
vb = int(b)
ans = 0

for i in range(va, vb+1):
    j = 0
    si = str(i)
    kbflg = True
    while j < len(si) // 2:
        if si[j] != si[len(si)-1-j]:
            kbflg = False
        j = j + 1

    if kbflg:
       ans = ans + 1



print(ans)

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

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

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

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

print(c)

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):
  S=str(i)
  if S[0]==S[4] and S[1]==S[3]:
    cnt+=1
print(cnt)

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[-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())
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):
    if str(i)[::-1]==str(i):
        ans +=1
print(ans)

Solution (Python):

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

ans = 0
for i in range(a, b + 1):
    num = str(i)
    h = 0
    t = len(num) - 1
    while h <= t:
        if num[h] == num[t]:
            h += 1
            t -= 1
        else:
            break
    else:
        ans += 1
print(ans)

Solution (Python):
A,B=map(int,input().split())
quotient = 0
mod = 0
ans=0
for i in range(A,B+1):
	num=[]
	quotient=i
	while quotient !=0:
		mod= quotient%10
		quotient = quotient//10
		num.append(mod)
	if num[0]==num[4] and num[1]==num[3]:
		ans =ans+1
print(ans)

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

count = 0
for i in range(A, B + 1):
    s = str(i)
    L = len(s)
    if (s[L - 1] == '0'):
        
        continue
    r = list(reversed(s))
    ner = ''.join(r)
    
    
    if (s == ner):
        
        count += 1

print(count)

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())
cnt=0
def is_pal(s):
    s_str=str(s)
    s_rev=str() 
    for i in range(1,len(str(s))+1):
        s_rev+=s_str[-i]
    
    if s_str==s_rev:
        return True
    else:
        return False
for i in range(A,B+1):
    if is_pal(i):
        cnt+=1
print(cnt)

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

def main():
    A, B = map(int, readline().rstrip().split())
    ans = 0
    for i in range(A, B+1):
        if str(i) == str(i)[::-1]:
            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) == str(i)[::-1]:
        cnt += 1
print(cnt)

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

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

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

Solution (Python):
A,B=map(int,input().split())
count=0
for m in range(A,B+1):
    m_list=list(str(m))
    if m_list==list(reversed(m_list)):
        count+=1
print(count)

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

Solution (Python):
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7

def main():
    A, B = map(int, readline().split())
    ans = 0
    for i in range(A,B+1):
        s = str(i)
        if s[:2]==s[5:2:-1]:
            ans += 1
    print(ans)



if __name__ == '__main__':
    main()

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):
from sys import stdin
import math


[A, B] = list(map(int, stdin.readline().rstrip().split()))

def isKaibun(n):
    s = str(n)
    for i in range(len(s)//2):
        if s[i] == s[-(i+1)]:
            continue
        else:
            return False
    return True


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

print(count)

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

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

i=A
ans=0
while i<=B:
    ans+=1*(i==int(str(i)[::-1]))
    i+=1
print(ans)

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

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

count = 0

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

Solution (Python):
def main():
    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)


if __name__ == '__main__':
    main()

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

for i in l:
    if i[0] == i[4]:
        if i[1] == i[3]:
            ans += 1
print(ans)

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

result = 0
for num in range(A, B+1):
    num_list = list(str(num))
    if (num_list[0] == num_list[4]) and (num_list[1] == num_list[3]):
        result += 1

print(result)

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

Solution (Python):
A,B = map(int,input().split())
ans = 0
for j in range(A,B+1):
    i = str(j)
    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())
count=0
for i in range(a, b+1):
  s=str(i)
  if s[0]==s[4] and s[1]==s[3]:
    count+=1
print(count)

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

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

    print(r)

if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split())
l=[0,0,0,0,0]
cnt=0
for i in range(a,b+1):
    x=i
    d=0
    while x>0:
        l[4-d]=x%10
        x=int(x/10)
        d+=1

    if l[0]==l[4] and l[1]==l[3]:
        cnt+=1

print(cnt)

Solution (Python):
A, B = map(int, input().split())
cnt = 0
for num in range(A, B + 1):
    flg = True
    for i in range(len(str(num)) // 2):
        if str(num)[i] != str(num)[-(i + 1)]:
            flg = False
            break

    if flg:
        cnt += 1

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):
    if i==int(str(i)[::-1]):
        ans+=1
print(ans)

Solution (Python):
A,B = map(int,input().split())
count = 0
for i in range(A,B+1):
	a = i // 10000
	b = i // 1000 - a*10
	c = i % 10
	e = i // 100 - a*100 - b * 10
	d = i // 10 - a*1000 - b * 100 - e *10
	if a == c and b == d :
		count+=1
print(count)

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

Solution (Python):
a, b = [int(x) for x in 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(a,b+1):
  s = str(i)
  if s[0]==s[-1] and s[1]==s[-2]:
    cnt +=1
print(cnt)

Solution (Python):
A, B = map(int,input().split())
ans = 0
for i in range(A,B+1):
    str_i = str(i)
    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):
    for j in range(len(str(i))//2):
        
        flag = True
        if str(i)[j] != str(i)[-(j+1)]:
            flag = False
            break
    if flag:
        ans += 1
print(ans)

Solution (Python):
A,B=map(int,input().split())
cnt=0
for i in range(A,B+1):
    i=str(i)
    if len(i)%2==0:
        if i[0:(len(i)/2)]==(i[(len(i)/2):])[::-1]:
            cnt+=1
        else:
            continue
    elif len(i)%2!=0:
        if i[0:(len(i)//2)+1]==(i[(len(i)//2):])[::-1]:
            cnt+=1
        else:
            continue
    else:
        continue
print(cnt)

Solution (Python):
import sys

IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))

INIT_VAL = 0
DP2 = lambda d1, d2: [[INIT_VAL]*d2 for _ in range(d1)]
DP3 = lambda d1, d2, d3: [[[INIT_VAL]*d3 for _ in range(d2)] for _ in range(d1)]

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

if __name__ == '__main__':
    main()

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

answer=0
for i in range(A,B+1):
  list_i=list(str(i))
  list_i_reverse=list_i[::-1]
  if tuple(list_i)==tuple(list_i_reverse):
    
    answer+=1
    
print(answer)

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

for i in range(x,y+1):
    if str(i) == str(i)[::-1]:
        ans += 1

print(ans)

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

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

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

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

print(ans)

Solution (Python):

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

for i in range(a,b+1):
    x = list(str(i))
    y = x.copy()
    y.reverse()
    if x == y:
        count += 1

print(count)

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

counter=0 

i=A

while i<=B:
    
    temp=str(i) 
    if (temp[0]==temp[4])and(temp[1]==temp[3]): 
        counter+=1 
    i+=1 

print(counter)

Solution (Python):
a, b = list(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())

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

import io

n,m=map(int,input().split())
counter=0
for i in range(n,m+1):
  il=list(str(i))
  if il==list(reversed(il)):
    counter+=1
print(counter)

Solution (Python):



import sys





def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number): return [LI() for _ in range(rows_number)]


def checkParin(checkNum):
    result = False
    checkNumStr = str(checkNum)
    checkNumStrBase = checkNumStr[::-1]
    charEq = 0
    for j in range(0, len(checkNumStrBase)):
        if checkNumStr[j] == checkNumStrBase[j]:
            charEq = charEq + 1
    if charEq == len(checkNumStr):
        result = True
    return result


def solver(fromNum, toNum):
    result = 0
    j = fromNum
    while ((fromNum <= j) and (j <= toNum)):
        if checkParin(j):
            result = result + 1
        j = j + 1
    return result


if __name__ == "__main__":
    A, B = MI()
    print("{}".format(solver(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(a,b+1):
    x = str(i)
    if x[0]==x[4] and x[1]==x[3]:
        cnt += 1
print(cnt)

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

Solution (Python):
def main():
    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)
main()

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())
nums = 0
for i in range(a, b + 1):
    i_str = str(i)
    nums = nums + 1 if i_str == i_str[::-1] else nums
print(nums)

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)
    flag = True
    for j in range(len(s)):
        if s[j] != s[-j-1]:
            flag = False
    ans += flag

print(ans)

Solution (Python):
def myAnswer(A:int,B:int)-> int:
   total = 0
   for i in range(A,B+1):
      tmp =str(i)
      if(tmp[:2]==tmp[:2:-1]):
         total+=1
   return total

def modelAnswer():
   tmp=1
def main():
   A, B = map(int,input().split())
   print(myAnswer(A,B))

if __name__ == '__main__':
   main()

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

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):
    s = list(str(i))
    s.reverse()
    s = ''.join(s)
    if s == str(i):
        ans += 1

print(ans)

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

counter = 0

for i in range(B-A+1):
    n = A + i
    s = list(str(n))
    st = ""
    for j in range(5):
        st += s[4-j]
    if int(st) == n:
        counter += 1
    else:
        continue

print(counter)

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

counter = 0

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

print(counter)

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

Solution (Python):
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    s = []
    t = []
    c = str(i)
    for j in range(len(c)):
        s.append(c[j])
        t.append(c[len(c)-j-1])
    if s == t:
        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):

import sys


def solve(A: int, B: int):
    print(sum(
        1
        for i in range(A, B + 1)
        if str(i) == str(i)[::-1]
    ))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(A, B)


if __name__ == '__main__':
    main()

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
print(count)

Solution (Python):



import sys





def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solver(fromNum, toNum):
    result = 0
    
    for number in range(fromNum, toNum+1):
        strNum = str(number)
        if strNum[0] == strNum[4]:
            if strNum[1] == strNum[3]:
                result = result + 1
    return result


if __name__ == "__main__":
    A, B = MI()
    print("{}".format(solver(A, B)))

Solution (Python):
def kai(n):
    a=""
    for i in reversed(range(len(n))):
        a+=(n[i])
    if n==a:
        return True

a,b=input().split()
cnt=0
for i in range(int(b)-int(a)+1):
    if kai(str(int(a)+i)):
        cnt+=1

print(cnt)

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

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

print(ans)

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

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

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

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

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

Solution (Python):
import sys

def resolve():
    A, B = list(map(int, input().split(" ")))
    cnt = 0
    for i in range(A, B+1):
        s = str(i)
        if s[0] == s[4] and s[1] == s[3]:
            cnt += 1
    print(cnt)

if '__main__' == __name__:
    resolve()

Solution (Python):



import sys





def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number): return [LI() for _ in range(rows_number)]


def palindromic(Num):
    result = False
    strNum = str(Num)
    strRevNum = strNum[::-1]
    checkDigit = 0
    for j in range(0, len(strNum)):
        if strNum[j] == strRevNum[j]:
            checkDigit = checkDigit + 1
    if checkDigit == len(strNum):
        result = True
    return result


def solver(fromNum, ToNum):

    result = 0
    for j in range(fromNum, ToNum+1, +1):
        if palindromic(j):
            result = result + 1
    return result


if __name__ == "__main__":
    A, B = MI()
    print("{}".format(solver(A, B)))

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

for i in range(a, b + 1):
    if i % 10  == i // 10000:
        if (i % 100 - i % 10) // 10 == i // 1000 - i // 10000 * 10:
            ans += 1

print(ans)

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

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[-1] and i[1] == i[-2]:
        count += 1
print(count)

Solution (Python):
def Kaibun(s):
    imax = int(len(s)/2)
    i = 0
    while i < imax:
        if s[i] != s[-(1+i)]:
            return False
        i += 1
    return True
    
a,b = map(int,input().split(' '))
List = [str(i) for i in range(a,b+1)]
count = 0
for s in List:
    if Kaibun(s):
        count += 1
print(count)

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

count = 0
for i in range(a, b+1):
    x = str(i)
    flag = True
    for j in range(len(x)//2):
        if x[j]!=x[len(x)-1-j]:
            flag = False
        
        
    
    
    if flag:
        count += 1          

print(count)

Solution (Python):

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

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

print(ans)

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B = il()
    ret = 0
    for n in range(A, B+1):
        n = list(str(n))
        if n[:len(n)//2] == n[len(n)//2+1:][::-1]:
            ret += 1
    print(ret)


if __name__ == '__main__':
    main()

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

ans = 0

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

Solution (Python):
a,b = map(int, input().split())
count = 0
for i in range (a,b+1):
    s = str(i)
    if (s[0]==s[4] 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):
  s = str(i)
  if(s[0] == s[4] and s[1] == s[3]):
    count += 1
print(str(count))

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