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-----
11009 11332

-----Sample Output-----
4

There are four integers that satisfy the conditions: 11011, 11111, 11211 and 11311.

Difficulty: introductory

Starter code:

Solutions:
a,b = map(int,input().split())
ans = 0
for i in range(a,b+1):
    c = str(i)
    l = len(c)
    d = l // 2
    cnt = 0
    for i in range(d):
        if c[i] == c[-i-1]:
            cnt += 1
    if cnt == d:
        ans += 1
print(ans)

A,B = list(map(str,input().split()))
La = [int(A[:3]),int(A[3:])]
Lb = [int(B[:3]),int(B[3:])]
L = 900 - (La[0] - 100) - (999 - Lb[0])
ch1 = int(A[1] + A[0])
ch2 = int(B[1] + B[0])
if Lb[1] < ch2:
  L -= 1
if ch1 < La[1]:
  L -= 1
print(L)
  


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

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

count = 0

for i in range(A, B+1):
    check = 0
    str_i = str(i)
    for j in range(0, (len(str_i)//2)+1):
        if int(str_i[j]) != int(str_i[-1-j]):
            check += 1
    if check == 0:
        count += 1

print("{}".format(count))

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

ans = 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:
                ans += 1
print(ans)

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

for i in range(a, b+1):
    l = []
    while (i > 0):
        l.append(i%10)
        i//=10
    if (l[0] == l[4] and l[1] == l[3]):
        cnt+=1
print(cnt)


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)

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

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

print(count)

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)

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

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

# import math
# import statistics
# a=input()
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(i)
e1,e2 = map(str,input().split())
# f = list(map(int,input().split()))
#g = [input() for _ in range(a)]
# h = []
# for i in range(e1):
#     h.append(list(map(int,input().split())))
c=[]
count=0
ans=0
for i in range(int(e1),int(e2)+1):
    count=0
    for k in range(len(str(i))//2):
        if str(i)[k]==str(i)[-(k+1)]:
            count+=1
            if len(str(i))//2 == count:
                ans+=1

print(ans)

a, b = map(int, input().split())
ans = 0
for i in range(a,b+1):
    num = 0
    j = i
    while j > 0:
        r = j % 10
        j //= 10
        num = num * 10 + r
    if i == num:
        ans += 1


print(ans)

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

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

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

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


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

cnt = 0
for i in range(A, B + 1):
    i = str(i)
    x = len(i) // 2
    left = i[0: x]
    right = i[x + 1 :]
    reverse_right = right[::-1]
    if left == reverse_right:
        cnt += 1
print(cnt)

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

Numbers = []

for i in range(A,B+1):
    number = str(A)
    # print(number)
    if number[0] == number[4] and number[1] == number[3]:
        Numbers.append(number)
    A += 1

print(len(Numbers))

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)


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)

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

ans = 0
for i in range(a, b+1):
    i = list(str(i))
    t_size = len(i)
    if t_size%2 == 0:
        if i[:t_size//2] == list(reversed(i[t_size//2:])):
            ans+=1
    else:
        if i[:t_size//2] == list(reversed(i[t_size//2+1:])):
            ans+=1
print(ans)

ab = list(map(int, input().split()))
a, b = ab[0], ab[1]
count = 0

for num in range(a, b + 1):
    str_num = str(num)
    str_num_reversed = "".join(list(reversed(str_num)))
    if str_num == str_num_reversed:
        count += 1

print(count)


lst = input().split()

count = 0

def judge(n):
   if str(n) == str(n)[::-1]:
      return True
   else:
      return False

for i in range(int(lst[0]), int(lst[1]) + 1):
   if judge(i):
      count += 1

print(count)

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

cnt = 0
for i in range(A,B+1):
  s = str(i)
  half = len(s) // 2
  add = len(s) % 2
  #print(s,-1, s[0:half],-1, s[half+add:][::-1])
  if s[0:half] == s[half+add:][::-1]:
    cnt += 1
    
print(cnt)

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

for k in range(a, b + 1):
    kk = str(k)
    if kk == kk[::-1]:
        answer += 1

print(answer)

a, b = (int(i) for i in 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)

a, b = input().split()

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

print(count)


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

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

print(ans)


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)

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

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

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)

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
# mod = 9982443453
# mod = 998244353
INF = float('inf')
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())
a,b = readInts()
ans = 0
for num in range(a,b+1):
    s = str(num)
    if s == s[::-1]:
        ans += 1
print(ans)


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

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


#!/usr/bin/env python3

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

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

print(ans)


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%100)//10:
        cnt+=1
print(cnt)

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


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

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

result = 0
for x in range(a, b+1):
  if str(x) == ''.join(reversed(str(x))):
    result += 1
print(result)

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

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)

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)

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

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


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

ans = 0
for x in range(a, b + 1):
    if x // 10000 == x % 10 and (x // 1000) % 10 == (x // 10) % 10:
        ans += 1
print(ans)


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

for i in range(a,b+1):
  lis_i = list(str(i))
  lis_i.reverse()
  rev_i = int(''.join(lis_i))
  if rev_i == i:
    cnt += 1
    
print(cnt)


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





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

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


A, B = list(map(int, input().split()))
ans = 0
for i in range(A, B + 1):
    S = str(i)
    N = len(S)
    if all(S[i] == S[-i - 1] for i in range(N // 2)):
        ans += 1
print(ans)


def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    a, b = Input()
    ans = 0
    for i in range(a, b + 1):
        str_i = list(str(i))
        if str_i[0] == str_i[-1] and str_i[1] == str_i[-2]:
            ans += 1
    print(ans)


main()

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

def ans090(A:int, B:int):
    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
    return count

print(ans090(A,B))

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)

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

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

print(ans)


def isPal(s):
    s = str(s)
    n = len(s)
    f = 1
    for i in range(n//2):
        f &= s[i] == s[n-i-1]
    return f

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

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

print(ans)



A,B=map(int,input().split())
result=0
for i in range(A,B+1):
  i=str(i)
  for j in range(int(((len(i))-1)/2)+1):
    if not i[j]==i[-j-1]:
      break
  else:
    result+=1
print(result)

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

ans = 0

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


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

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

print(cnt)

a, b = list(map(int, input().split()))
res = 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]:
        res += 1

print(res)


def reverse(num):
    test_num = 0
    while (num > 0):
        remainder = num % 10
        test_num = (test_num * 10) + remainder
        num = num // 10
    return test_num

a,b = list(map(int,input().split()))
c = 0
for i in range(a,b+1):
    if i == reverse(i):
        c+=1
print(c)

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)

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

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

for i in range(a//10000, b//10000+1):
    for j in range(0,10):
        for k in range(0,10):
            x = i*10001 + j*1010 + k*100
            if a<=x<=b:
                ans+=1
print(ans, flush=True)



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


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

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

ans=0

for i in range(A,B+1):
    for j in range(len(str(i))):
        zen = j
        kou = len(str(i))-1-j
        if zen >= kou:
            ans+=1
            break
        if str(i)[zen] != str(i)[kou]:
            break
    
print(ans)

A, B = map(int,input().split())
ans_cou = 0
for i in range(A, B + 1):
    str_i = str(i)
    reverse_str_i = ''.join(list(reversed(str_i)))
    reverse_int_i = int(reverse_str_i)
    if i == reverse_int_i:
        ans_cou += 1
print(ans_cou)

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

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

def kaibun(n):
    if str(n)[0]==str(n)[-1] and str(n)[1]==str(n)[-2]:
        return True
    else:
        return False

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

def answer(a: int, b: int) -> int:
    count = 0
    for i in range(a, b + 1):
        i_str = str(i)
        if i_str[0] == i_str[-1] and i_str[1] == i_str[-2]:
            count += 1

    return count


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


def __starting_point():
    main()

__starting_point()

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)

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

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

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


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)

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

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

print(k)


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

import sys
import copy
import math
import itertools
import numpy as np
l = [int(c) for c in input().split()]
A = l[0]
B = l[1]
cnt=0
for i in range(A,B+1):
    if str(i)[0]==str(i)[4] and str(i)[1]==str(i)[3]:
        cnt+=1
print(cnt)

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

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

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

N = {} #10000以上key以下の回文数の個数
cnt = 0
for i in range(10000, 100000):
    L = list(str(i))
    if L == list(reversed(L)):
        cnt += 1
    N[i] = cnt
A, B = map(int, input().split())
print(N[B]-N[A-1] if A > 10000 else N[B])

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)

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

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


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

def judege_palindromic(val_str):
    length = len(val_str)
    match = True
    for i in range(length//2):
        if val_str[i] != val_str[length-i-1]:
            match = False
            break

    return match       


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

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

print(cnt)

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)

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

def check(p):
  p = str(p)
  if p[0] == p[4] and p[1] == p[3]:
    return True
  return False

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

a, b = list(map(int, input().split()))
cnt = 0
l = []
newl = []

for i in range(a, b+1):
    l = []
    while (i > 0):
        l.append(i%10)
        i//=10
    newl = l[::-1]
    if (l == newl):
        cnt+=1
print(cnt)


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)

#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    numbers=[]
    a,b = map(int,input().split())
    numbers=list(range(a,b+1))
    count=0

    for number in numbers:
        if str(number)[0]==str(number)[-1] and str(number)[1]== str(number)[3]:
            count+=1
    print(count)

def __starting_point():
    main()
__starting_point()

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

cnt = 0

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

print(cnt)

a,b=input().split()
a=int(a)
b=int(b)
c=0
for i in range(a,b+1):
  if (i//10000)==(i-(i//10)*10) and (i//1000-(i//10000)*10) ==(i//10-(i//100)*10):
    c=c+1
print(c)

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

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

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

print(res)

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)


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

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

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

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 <= 10000*i+1000*j+100*k+10*j+i <= b:
                count += 1
print(count)

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)

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)

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)

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)