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

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

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

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

Solution (Python):
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 = map(int, input().split())
    print(answer(a, b))


if __name__ == '__main__':
    main()

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

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)

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

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

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
A, B =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])

Solution (Python):
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 = map(int, input().split())

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

print(ans)

Solution (Python):
A,B = map(int,input().split())
count = 0
for i in range(A,B+1):
  i = str(i)
  num = 1
  if len(i)%2 == 0:
    num = 0
  left = i[:len(i)//2]
  right = i[len(i)//2+num:]
  right = right[::-1]
  if left == right:
    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[:2]==s[3:][::-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):
    if i%10==i//10000 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())
cnt = 0

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

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

for i in range(A, B + 1):
    i = str(i)

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

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

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

Solution (Python):

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)

if __name__=="__main__":
    main()

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

Solution (Python):

import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
import copy
import math
from itertools import accumulate
sys.setrecursionlimit(10**6)




def floor(a, b): return -(-a // b)


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


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


def S(): return sys.stdin.readline()[:-1]


def C(line): return [sys.stdin.readline() for _ in range(line)]


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


a, b = zz()
ans = 0
for num in range(a, b + 1):
    if is_kaibun(str(num)):
        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())
k = 0

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

print(k)

Solution (Python):
A,B = 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)

Solution (Python):
A,B=map(int,input().split())
ans=0
for x in range(A,B+1):
    S=str(x)
    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 = 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)

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

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

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

Solution (Python):
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
  
  if s[0:half] == s[half+add:][::-1]:
    cnt += 1
    
print(cnt)

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

Solution (Python):







e1,e2 = map(str,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)

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

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

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

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

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

Solution (Python):


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)

Solution (Python):
A, B = 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)

Solution (Python):
A, B = 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)

Solution (Python):
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
    s=str(i)
    for j in range(len(s)//2):
        if s[j]!=s[-1-j]:
            break
    else:
        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 i == i[::-1]:
    cnt += 1
    
print(cnt)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    A, B = map(int, readline().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())

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

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

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

Solution (Python):
import sys
a,b = map(int, sys.stdin.readline().rstrip("\n").split())
ans = 0
for i in range(a,b+1):
    i,n1 = divmod(i, 10)
    i,n2 = divmod(i, 10)
    i,n3 = divmod(i, 10)
    n5,n4 = divmod(i, 10)
    if n1 == n5 and n2 == n4:
        ans += 1
print(ans)

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

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

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

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

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

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

Solution (Python):


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)

Solution (Python):
N = {} 
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])

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

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())
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=list(map(int,input().split()))
ct=0
for i in range(A,B+1):
  t=str(i)
  for j in range(len(t)):
    if t[j]!=t[-j-1]:
      break
  else:
      ct+=1
print(ct)

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

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

Solution (Python):



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


if __name__ == "__main__":
    main()

Solution (Python):



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


if __name__ == "__main__":
    main()

Solution (Python):



def main():
    a, b = map(int, input().split())
    c = 0
    for i in range(a, b + 1):
        s = str(i)
        r = "".join(reversed(list(s)))
        if s == r:
            c += 1
    print(c)


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

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)

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

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

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

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

Solution (Python):
def PalindJudge(num):
    
    judge = 1
    list = [0,0,0,0,0]
    
    for i in range(5):
        list[i] = num%10
        num //= 10
        
    for i in range(3):
        if list[i]!=list[4-i]:
            judge *= 0
            
    return judge

if __name__ == '__main__':
    
    a,b = map(int, input().split())
    
    count = 0
    
    for i in range(a, b+1):
        if PalindJudge(i) == 1:
            count += 1
            
    print(count)

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

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

if __name__ == "__main__":
    solve()

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



def main():
    A, B = map(int, open(0).read().split())
    print(
        len([0 for i in range(A, B + 1) if str(i) == "".join(list(reversed(str(i))))])
    )


main()

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

print(count)

Solution (Python):
def check(s):
    an = True
    for i in range(len(s)//2):
        if s[i] != s[-i-1]:
            an = False
    return an    
a,b = map(int, input().split())
ans = 0
for i in range(a,b+1):
    l = str(i)
    l2 = list(l)
    if check(l2):
        ans += 1
print(ans)

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

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

print(count)

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

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

count=0

for i in range(A,B+1):
    i_str=str(i)
    ri_str=i_str[::-1]
    ri=int(ri_str)
    if i==ri:
        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 = list(map(int, input().split()))

c = 0

for i in range(a, b+1):
    s = str(i)
    f = True
    for j in range(len(s)):
        
        if s[j] != s[-j-1]:
            f = False
            break
    if f:
        
        c += 1

print(c)

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

n = 0
for i in range(A,B+1):
    s = str(i)
    recursive = True
    for j in range(len(s)//2):
        if s[j] != s[len(s)-1-j]:
            recursive = False
            break
    if recursive:
        n += 1

print(n)

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

Solution (Python):
def resolve():
    a, b = map(int, input().split())
    count = 0
    for num in range(a, b+1):
        snum = str(num)
        if snum[0] != snum[4] or snum[1] != snum[3]:
            continue
        else:
            count += 1
    print(count)
resolve()

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
    else:
        continue
print(cnt)

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

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

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

cnt=0
for i in range(a,b+1):
    a = list(str(i))
    a.reverse()
    a="".join(a)
    if a == str(i):
        cnt += 1
    else:
        continue
print(cnt)

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

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

Solution (Python):
def resolve():
    '''
    code here
    '''
    A, B = [int(item) for item in input().split()]

    res = 0
    for i in range(A, B+1):
        temp_num_str = str(i)
        for j in range(len(temp_num_str)//2):
            if temp_num_str[j] != temp_num_str[-1 * (j+1)]:
                break
        else:
            res += 1

    print(res)
if __name__ == "__main__":
    resolve()

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

Solution (Python):
from sys import stdin
from numpy import argmin

a,b = [int(x) for x in stdin.readline().split()]
cnt = 0

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

Solution (Python):
A,B = map (int, input ().split ())
x = 0
while A <= B:
  if int(str(A)[0])==int(str(A)[4]) and int(str(A)[1])==int(str(A)[3]):
    x += 1
  A += 1
print (x)

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

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
else:
    print(ans)

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

for i in range(a,b+1):
    seki_gyaku = str(i)
    if seki_gyaku == seki_gyaku[::-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())
r = range(a, b+1)
cnt = 0
for i in r:
    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) :
  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):
    if int(i/10000)==i%10 and int(i/1000)%10 == int(i/10)%10:
        ans+=1
        
print(ans)

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

cnt = 0
for i in range(A,B+1):
  si = str(i)
  checking = si[::-1]
  if si == checking and int(checking) <= B:
    cnt += 1

print(cnt)

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

ans_list =[]

for i in range(int(A), int(B)+1):
    i_reversed = int(str(i)[::-1])
    if i_reversed == i:
        ans_list.append(i)
    i += 1
        
print(len(ans_list))

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

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

print(ans)

Solution (Python):
A=[int(x) for x in input().split()]
lower=A[0]//100
upper=A[1]//100
count=upper-lower+1
if A[0]>lower*100+int(str(lower)[0])+int(str(lower)[1])*10:
  count-=1
if A[1]<upper*100+int(str(upper)[0])+int(str(upper)[1])*10:
  count-=1
print(count)

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())
def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True
cnt = 0
for i in range(a, b+1):
    if is_kaibun(str(i)):
        cnt += 1
print(cnt)

Solution (Python):
a, b = map(int, input().split())
ans = 0
for num in range(a, b + 1):
  str_num = str(num)
  i = len(str_num) // 2
  if str_num[:i] == str_num[:i:-1]:
    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())

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

Solution (Python):

def resolve():
    import sys
    input = sys.stdin.readline
    
    
    
    a, b = [int(x) for x in input().rstrip().split(" ")]

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


if __name__ == "__main__":
    resolve()

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):
    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):
    a = str(i)
    b = ''
    for j in range(1, len(a) + 1):
        b += a[-j]
    if a == b:
        ans += 1
print(ans)

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

count = 0

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

print(count)

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

count = 0

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

print(count)

Solution (Python):



import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """11009 11332"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """31415 92653"""
        output = """612"""
        self.assertIO(input, output)


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


if __name__ == "__main__":
    
    resolve()