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):
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):
def kaibun(s):
    l=len(str(s))
    check=list(s)
    half=l//2
    a=check[:half]
    b=check[::-1][:half]
    if a==b:
        return True
    return False

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

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

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

Solution (Python):
A, B = input().split(" ")
count = 0

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

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

Solution (Python):
url = "https://atcoder.jp/contests/abc090/tasks/abc090_b"

def main():
    f = list(map(int, input().split(' ')))
    count = 0
    for i in range(f[0], f[1] + 1):
        n_str = list(str(i))
        n_str_r = list(reversed(n_str))
        flg = True
        for n in n_str:
            if n_str != n_str_r:
                flg = False
        if flg:
            count += 1
    print(count)


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

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

def f(x):
  if x==''.join(list(reversed(x))):
    return 1
  else:
    return 0

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

Solution (Python):
A,B=map(int,input().split())
ans = 0
for i in range(A,B+1):
  i1 = i % 10
  i2 = (i // 10) % 10
  i4 = (i // 1000) % 10
  i5 = (i // 10000) % 10
  if (i1 == i5) and (i2 == i4):
    ans += 1
print(ans)

Solution (Python):

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

def kaibun(x):
    l = str(x)
    r = str(x)[::-1]
    if l == r:
        return True
    else:
        return False
    
count = 0
for i in range(a, b+1):
    if kaibun(i):
        count += 1
    else:
        continue
        
print(count)

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

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

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

ans = 0
for i in range(a, b + 1):
    s = str(i)
    s = list(s)
    for j in range(len(s) // 2):
        if s[j] != s[len(s) - 1 - j]:
            break
        if j == (len(s) // 2) - 1:
            ans += 1

print(ans)

Solution (Python):

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

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

for number in range(int(A), int(B)+1):
    number = str(number)
    reverse_num = ""
    for i in reversed(range(len(number))):
        reverse_num += number[i]
    if number == reverse_num:
        ans += 1

print(ans)

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

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

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

print(ans)

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

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

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

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

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

ans = 0

def judge(s):
    for i in range(len(s) // 2):
        if s[i] != s[len(s) - i - 1]:
            return 0
    return 1

for i in range(a, b + 1):
    ans += judge(str(i))

print(ans)

Solution (Python):
n = input().rstrip().split()
n=[int(x) for x in n]

ans=0
for i in range(n[0],n[1]+1):
  ct=0
  a=list(str(i))
  for j in range(len(a)):
    if a[j]==a[-j-1]:
    	ct+=1
  if ct==len(a):
    ans+=1
print(ans)

Solution (Python):
A,B = map(int,input().split())
cnt = 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]):
        cnt+=1
print(cnt)

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

for number in range(A, B+1):
  x1 = str(number)
  x2 = x1[::-1]
  if x1[0:2] == x2[0:2]:
    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)]


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

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

    print(ret)


if __name__ == '__main__':
    main()

Solution (Python):
A, B = map(int, input().split())
N = 0
for i in range(A, B + 1):
  S = str(i)
  for j in range(2):
    if S[j] != S[4 - j]:
      break
  else:
    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 = map(int,input().split())

def li(x):
    L = []
    while x > 0:
        L.append(x % 10)
        x = x // 10
    return L

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

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  a,b = map(int,input().split())
  p = a
  cnt = 0
  while a <= p <= b:
    P = str(p)
    if P == P[::-1]:
      cnt += 1
    p += 1
  print(cnt)
if __name__ == '__main__':
  main()

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

Solution (Python):
import sys

def cnt(n):
    m = str(n)
    l = len(m)
    if l == 1: return n + 1
    tot = 0
    tot += pow(10, (l - 1) // 2) * (int(m[0]) - 1)
    tot += pow(10, l // 2) - 1 - 9 * pow(10, l // 2 - 1) * (l & 1 ^ 1)
    while l >= 2:
        l -= 2
        if l == 0: tot += m[1] >= m[0]
        elif l == 1: tot += int(m[1]) + 1 - (m[-1] < m[0])
        else:
            m = str(int(m[1:-1]) - (m[-1] < m[0]))
            m = '0' * (l - len(m)) + m
            tot += int(m[0]) * pow(10, (l - 1) // 2)
    return tot

a, b = map(int, sys.stdin.readline().split())

def main():
    print(cnt(b) - cnt(a-1))

if __name__ ==  '__main__':
    main()

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

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

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

ans=0
for i in range(A,B+1):
  n=str(i)
  if n[0]==n[-1] and n[1]==n[-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):
  line = list(map(int,str(i)))
  if line[0] == line[4] and line[1] == line[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)
    l=len(s)
    for i in range(l//2):
        if s[i]!=s[l-1-i]:
            break
    else:
        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 == s[::-1]:
        ans += 1
print(ans)

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

def ok(n):
    s = str(i)
    l = len(s)
    for j in range(l):
        if s[j] != s[-(j + 1)]:
            return False
    return True

ans = 0
for i in range(A, B + 1):
    if ok(i):
        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 = ans + 1

print(ans)

Solution (Python):
def isp(str): return True if str == str[::-1] else False
a,b= map(int, input().split())
ans=0
for i in range(a,b+1):
  i_s=str(i)
  if isp(i_s):
    ans+=1

print(ans)

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

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

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

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

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

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

print(x)

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

cnt = 0
for i in range(a, b+1):
  r = ''.join(list(reversed(str(i))))
  if i == int(r):
    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())


def f(s):
    return ''.join(reversed(s))


ans = 0
for i in range(a, b + 1):
    i = str(i)
    if i == f(i):
        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 == s[:: -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[0]==s[4] and s[1]==s[3]:
        ans += 1
print(ans)

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

ans = parind[B]-parind[A-1]
print(ans)

Solution (Python):

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

count=0
for n in range(a,b+1):
    s = str(n)
    array = list(map(int, s))

    if array[0]==array[-1]:
        if array[1]==array[-2]:
            if array[2]==array[-3]:
                count+=1

print(count)

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

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,b=map(int,input().split())
count=0

def Palindrome(string):
    number=str(string)
    if number==number[::-1]:
        return True
    else:
        return False

for i in range(a,b+1):
    if Palindrome(i)==True:
        count+=1
print(count)

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

cnt = 0
for n in range(A, B + 1):
    s = str(n)
    if s[:2] == s[4] + s[3]:
        cnt += 1

print(cnt)

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


if __name__ == "__main__":
    main()

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

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

ans=0
for i in range(1,10):
	for k in range(10):
		for j in range(10):
			bun=i*10000+k*1000+j*100+k*10+i
			if A<=bun<=B:
				ans+=1

print(ans)

Solution (Python):
a,b = map(int,input().split())
cnt=0
for i in range(a,b+1):
    r = ''.join(list(reversed(str(i))))
    if str(i)==r:
        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 n in range(A, B+1):
  strn = str(n)
  if strn[0] == strn[-1] and strn[1] == strn[-2]:
    count += 1
print(count)

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

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()))
count = 0
for i in range(a,b+1):
    num_str = str(i)

    if (num_str[0] == num_str[4]) and (num_str[1] == num_str[3]):
        count += 1
print(count)

Solution (Python):
def chekdigits(i):
    s = str(i)
    return (s[0]==s[-1]) and (s[1]==s[-2])
A,B=map(int, input().split())
print(len([x for x in range(A,B+1) if chekdigits(x)]))

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

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

Solution (Python):
def reverseDisits(n):
    s = ""
    while n > 0:
        s += str(n % 10)
        n //= 10
    return int(s)


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

Solution (Python):
A, B = map(int, input().split())
ans = 0
for n in range(A, B+1):
    s = str(n)
    ans += (s == s[::-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):
import math
import string


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

a, b = map(int, input().split())
l = [None]*5
cnt = 0
for i in range(1, 10):
    l[0] = str(i)

    for j in range(0, 10):
        l[1] = str(j)

        for k in range(0, 10):
            l[2] = str(k)
            l[3] = str(j)
            l[4] = str(i)
            s = ''.join(l)
            
            if int(s) >= a and int(s) <= b:
                cnt += 1
print(cnt)

Solution (Python):
import sys
import math

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

kaibun_cnt = 0
length = len(str(a))
length_half = math.floor(len(str(a))/2)

for i in range(a, b+1):
    num_list = []
    num = i
    
    for j in range(len(str(i))):
        num_list.append(num%10)
        num = math.floor(num/10)
    
    cnt = 0
    for j in range(length_half):
        if num_list[j] == num_list[length-j-1]:
            cnt += 1
    
    if cnt == length_half:
        kaibun_cnt += 1

print("{}".format(kaibun_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 = 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())
c = 0
f = 1

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

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

Solution (Python):
def P_Number(a , b):

    ans = 0

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

    return ans

def main():
    a , b = map(int , input().split())
    print(P_Number(a , b))


if __name__ == '__main__':
    main()

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

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

print(ans)

Solution (Python):
x = []
for i in range(10):
    for j in range(10):
        for k in range(10):
            tmp = i*10001 + j*1010 + k*100
            x.append(tmp)
x.sort()

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

ret = sum((a<= z and z <= b) for z in x)
print(ret)

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

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

for i in range(a, b+1):
  digit1 = i % 10
  i = i // 10
  digit2 = i % 10
  i = i // 10
  digit3 = i % 10
  i = i // 10
  digit4 = i % 10
  i = i // 10
  digit5 = i % 10
  
  if digit1 == digit5 and digit2 == digit4:
    count +=1

print(count)

Solution (Python):

def main():
    import sys
    
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    
    from itertools import combinations, permutations
    
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    

    

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


if __name__ == '__main__':
    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):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

A, B = na()

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

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

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

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

a,b = MAP()
ans = 0
for i in range(1, 10): 
    for j in range(0, 10): 
        for k in range(0, 10): 
            s = str(i) + str(j) + str(k) + str(j) + str(i)
            s = int(s)
            if a <= s <= b:
                ans += 1
print(ans)

Solution (Python):
a = input().split(" ")
start = a[0]
start = list(map(int, start))
end = a[1]
end = list(map(int, end))

if (end[0] - start[0]) != 0:
    ans = (end[0] - start[0]  - 1) * 100 + end[1] * 10 + end[2] + 1 + (9 - start[1]) * 10 + (10 - start[2])
    if (start[1]*10 + start[0])  < (start[3] * 10 + start[4]) :
        ans -=   1
    if (end[1] * 10 + end[0]) > (end[3] * 10 + end[4]):
        ans -= 1

else:
    if (end[1] - start[1]) != 0:
        ans = (end[1] - start[1] - 1)  * 10 + end[2] + (10 - start[2])
        if (start[1]*10 + start[0])  < (start[3] * 10 + start[4]) :
            ans -=  1
        if (end[1] * 10 + end[0]) > (end[3] * 10 + end[4]):
            ans -= 1
                

        
    else:
        ans = end[2] - start[2] + 1
        if (start[1]*10 + start[0])  < (start[3] * 10 + start[4]) :
            ans -= 1
        if (end[1] * 10 + end[0]) > (end[3] * 10 + end[4]):
            ans -= 1

print(ans)

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

print(ans)

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

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


    if i == list(reversed(i)):
        ans += 1

print(ans)

Solution (Python):








def resolve():
    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)


resolve()

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

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

cnt = 0
for x in range(a,b+1):
    if str(x)[:2] == str(x)[4:2:-1]:
        cnt += 1

print(cnt)

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

a, b = [int(x) for x in stdin.readline().rstrip().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())
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)[0] == str(i)[-1]:
        if str(i)[1] == str(i)[-2]:
            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[-1] and i[1] == i[-2]:
        count += 1
print(count)

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

for i in range(A,B+1):
    t=list(str(i))
    if t[::-1][0]=="0":
        pass
    else:
        if t==t[::-1]:
            cnt+=1
        
print(cnt)

Solution (Python):
A,B = list(map(int,input().split()))
i=[]
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())

cnt=0
for i in range(A,B+1,1):
    i = str(i)
    len_i = len(i)
    tmp=0
    for j in range(len_i//2):
        if i[j]==i[-j-1]:
            tmp+=1
        else:
            break
    if tmp==len_i//2:
        cnt+=1
print(cnt)

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

Solution (Python):


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

ans = 0
for i in range(a,b+1):
    if str(i) == "".join(reversed((str(i)))):
        ans += 1

print(ans)

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

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

a10 = int(''.join(list(reversed(A[0:2]))))
a34 = int(A[3:5])
if a10 < a34:
  amin = int(A[1:3]) + 1
else:
  amin = int(A[1:3])

b10 = int(''.join(list(reversed(B[0:2]))))
b34 = int(B[3:5])
if b10 <= b34:
  bmin = 100 - int(B[1:3]) - 1
else:
  bmin = 100 - int(B[1:3])

n0 = int(B[0]) - int(A[0]) + 1

print(n0 * 100 - amin - bmin)

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

i=a
cnt=0
while i<=b:
  temp=str(i)
  if temp[0]==temp[4] and temp[1]==temp[3]:
    cnt+=1
  
  i+=1
print(cnt)

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

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

Solution (Python):


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

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

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

cnt = 0
for value in range(A, B+1):
  length = len(str(value))
  
  
  value_back = ""
  for i in range(length):
  	value_back += str(value)[length - i -1]
  if value == int(value_back):
    cnt +=1
  

print(cnt)

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

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

def is_palindromic(n):
    s, t = n % 10, (n // 10000) % 10
    u, v = (n // 10) % 10, (n // 1000) % 10
    if s == t and u == v:
        return True
    return False

count = 0
for n in range(A, B+1):
    if is_palindromic(n):
        count += 1
print(count)

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

def is_palindromic(n):
    sep_idx = len(n) // 2
    if n[:sep_idx] == n[sep_idx+1:][::-1]:
        return True
    return False

count = 0
for n in range(A, B+1):
    n_str = str(n)
    if is_palindromic(n_str):
        count += 1
print(count)

Solution (Python):
A, B = map(int , input().split())
res = 0
for n in range(A, B+1):
    l = []
    while(n > 0):
        l.append(n%10)
        n //= 10
    if (l[0]==l[4] and l[1]==l[3]):
        res += 1
print(res)

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

Solution (Python):
A_low, B_upp = map(int, input().split())
cnt = 0

for i in range(A_low, B_upp + 1):
    str_num = str(i)

    if (str_num[0] == str_num[4] and str_num[1] == str_num[3]):
        cnt += 1

print(cnt)

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

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

if a < 10000 or b > 99999:
    sys.exit(1)

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

print(cnt)

Solution (Python):
A,B = list(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):
def check(s):
  return s == s[::-1]

a, b = map(int, input().split())
print(sum(check(str(v)) for v in range(a, b+1)))

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

cnt= 0
for i in range(A,B+1):
    s = str(i)
    s2 = s[::-1]
    if s == s2:
        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,b=input().split()
count=0
for i in range(int(a),int(b)+1):
  if str(i)==str(i)[::-1]:
    count+=1
print(count)