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[4]+s[3]+s[2]+s[1]+s[0]:
        ans +=1
print(ans)

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

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(" "))
counter =0
for i in range(A,B+1):
  I = str(i)
  if I == I[-1::-1]:
    counter +=1

print(counter)

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

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

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

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

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

Solution (Python):
from sys import stdin
a, b = [int(_) for _ in stdin.readline().rstrip().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())
count=0
for i in range(a,b+1):
    s=str(i)
    ss=s[::-1]
    if s==ss:
        count+=1
print(count)

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

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

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

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

Solution (Python):
a,b=map(int,input().split())
count=0
for c in range(1,10):
    for d in range(0,10):
        for e in range(0,10):
            s=c*10001+d*1010+e*100
            if s in range(a,b+1):
                count+=1
print(count)

Solution (Python):
def solve(string):
    a, b = map(int, string.split())
    count = 0
    for i in range(a, b + 1):
        i = str(i)
        l = len(str(i))
        if i[:(l + 1) // 2] == i[l // 2:][::-1]:
            count += 1
    return str(count)


if __name__ == '__main__':
    print(solve(input()))

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


if __name__ == '__main__':
    print(solve(input()))

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

count = 0
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            n = int(''.join(list(map(str, [i, j, k, j, i]))))
            if n >= a:
                if n <= b:
                    
                    count += 1
                else:
                    continue
            else:
                continue
print(count)

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



import sys


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):
def kaibun(n):
  p=list(str(n))
  for i in range(len(p)//2):
    if p[i]!=p[len(p)-i-1]:
      return 0
  return 1
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
  if kaibun(i):
    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(count)

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

ans = 0
for i in range(A, B + 1):
    xs = []
    x = i
    while x > 0:
        xs.append(x % 10)
        x //= 10
    if xs == list(reversed(xs)):
        ans += 1

print(ans)

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

count = 0
for i in range(A // 10000, B // 10000 + 1):
    for j in range(0, 10):
        for k in range(0, 10):
            t = i * 10000 + j * 1000 + k * 100 + j * 10 + i
            if A <= t <= B:
                count += 1
print(count)

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

ans = 0
for i in range(A, B + 1):
    if i // 10000 == i % 10 and (i // 1000) % 10 == (i // 10) % 10:
        ans += 1
print(ans)

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

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

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())
ans = 0
for i in range(A,B+1):
	cnt = 0
	for j in range(5):
		if str(i)[j] == str(i)[4-j]:
			cnt = cnt + 1
	if cnt == 5:
	    ans = 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):
n,m = map(int,input().split())
a = 0
for i in range(n,m+1):
  ii = str(i)
  if ii == ii[::-1]:
    a += 1
print(a)

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

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

print(count)

Solution (Python):

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

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

print(answer)

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

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

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

c = 0

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

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

Solution (Python):
a, b = (int(i) for i in input().split())

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

    if flg:
        count+=1

print(count)

Solution (Python):
def is_palindromic(n: int) -> bool:
    s = str(n)
    l = len(s)
    for i in range(l//2):
        if s[i] != s[-(i+1)]:
            return False
    return True


def palindromic_numbers(A: int, B: int) -> int:
    return sum(is_palindromic(n) for n in range(A, B+1, 1))


if __name__ == "__main__":
    A, B = map(int, input().split())
    ans = palindromic_numbers(A, B)
    print(ans)

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

Solution (Python):
import collections
import itertools
import numpy as np
import sys
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()


a,b = IL()
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())


def is_kaibunsu(num):
    s_num = str(num)
    
    if s_num[0:2] == s_num[-2:][::-1]:
        return True
    else:
        return False


res = 0
for _n in range(A, B + 1):
    if is_kaibunsu(_n): res += 1
print(res)

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

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

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

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

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

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

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

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

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

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

def calc(n):
    if len(n) == 1:
        return True
    elif n[0] == n[-1]:
        n = n[1:-1]
        return calc(n)
    else:
        return False

count = 0

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

print(count)

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

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

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

for i in range(A,B+1):
  str0 = list(str(i))
  str1 = list(str(i))
  str1.reverse()
  if(str0 == str1):
    count += 1
    
print(count)

Solution (Python):


import itertools
import collections
import bisect

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


if __name__ == '__main__':
    main()

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 iskaibun(A):
    if A[0] == A[4] and A[1] == A[3]:
        return True
    else:
        return False

x = list(map(int,input().split()))
s = x[0]
f = x[1]+1
cnt = 0
for i in range(s, f):
    if iskaibun(str(i)):
        cnt += 1
print(str(cnt))

Solution (Python):
def check(n):
    nn = [n//10**x % 10 for x in range(5)]
    return nn[0] == nn[4] and nn[1] == nn[3]


def main():
    A, B = map(int, input().split())
    ans = 0
    for i in range(A, B+1):
        if check(i):
            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):
    n = str(i)
    if n[0] == n[4] and n[1] == n[3]:
        ans += 1
print(ans)

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

Solution (Python):
import sys

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


if __name__ == '__main__':
    main()

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

count = 0
for i in range(a,b+1):
    n = list(str(i))
    n = n[::-1]
    n = int("".join(map(str,n)))
    if n == i:
        count += 1

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

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

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

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

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

Solution (Python):

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

Solution (Python):
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):
def main():
    A, B = map(int, input().split())
    c = 0
    for i in range(A, B + 1):
        if str(i)[:2] == str(i)[4] + str(i)[3]:
            c += 1
    print(c)


main()

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

Solution (Python):
A,B=list(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 sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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


def check(n):
    s = str(n)
    for c, cr in zip(s, reversed(s)):
        if c == cr:
            continue
        else:
            return False
    return True


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

Solution (Python):
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))

A,B=rl()

c_a = A//100 - 100 + 1
c_b = B//100 - 100 + 1
if A > (A//100*100 + A//10000 + (A//1000-A//10000*10)*10):
    c_a += 1
if B >= (B//100*100 + B//10000 + (B//1000-B//10000*10)*10):
    c_b += 1

print(c_b-c_a)

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

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

Solution (Python):
A, B = map(int, input().split())
x = range(1,10)
y = range(10)
count = 0
for p in x:
    for q in y:
        for r in y:
            sakasama = int(str(p)+str(q)+str(r)+str(q)+str(p))
            if A <= sakasama <= B:
                count += 1
print(count)

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

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

print(c)

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


if __name__ == "__main__":
    main()

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

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

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, raw_input().split())

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

Solution (Python):

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


count = 0
for i in range(a, b + 1):
    l1 = i//10000
    l2 = (i//1000)%10
    r1 = i%10
    r2 = (i%100)//10

    b = l1==r1 and l2==r2


    count += 1 if b else 0

print(count)

Solution (Python):
a,b=map(int,input().split())
s=0
for i in range(a,b+1):
    x=list(str(i))
    y=[]
    for k in range(len(x)):
        y.append(x[-1-k])
    z=""
    for j in y:
        z+=j
    if i==int(z):
        s+=1
print(s)

Solution (Python):
a,b=map(int,input().split());c=0
while a<=b:s=str(a);c+=s==s[::-1];a+=1
print(c)

Solution (Python):
a,b=map(int,input().split());c=0
while a<=b:s=str(a);c+=s==s[::-1];a+=1
print(c)

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):
    lst = list(str(i))
    rvs = lst[4] + lst[3] + lst[2] + lst[1] + lst[0]
    if rvs == str(i):
        cnt += 1
 
    

print(cnt)

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

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

ans=0

for i in range(a,b+1):
	l=[]
	r_l=[]
	temp=0
	while(i!=0):
		l.append(i%10)
		
		i=int(i/10)
	old_l=l
	old_l=tuple(old_l)

	l.reverse()

	l=tuple(l)

	for i in range(len(l)):
		if(l[i]!=old_l[i]):
			temp=1
			break

	if(temp==0):
		ans+=1

print(ans)

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

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

Solution (Python):
a,b=map(int,input().split())
l = [str(i) for i in range(a,b+1)]
count=0
for i in l:
    if i == 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 = str(i)
    length= len(i_str)
    list1 = []
    list2 = []
    for j in range(length):
        list1.append(i_str[j])
    for k in range(length):
        list2.append(i_str[-k-1])
    if list1 == list2:
        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[-1] and s[1] == s[-2]:
        count+=1
print(count)

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

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

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

print( countPalindromicNum( A, B ) )

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

count = 0
for i in range(int_a, int_b + 1):
    if i == int(str(i)[::-1]):
        count += 1

print(count)

Solution (Python):
a,b = map(int,input().split())
def f(s):
    if s==s[-1::-1]:
        return True
ans = 0
for i in range(a,b+1):
    if f(str(i)):
        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):
  i=str(i)
  j=i[::-1]
  if i==j:
    ans+=1
print(ans)

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

Solution (Python):
a, b = map(int,input().strip().split(' '))
a_rev = ""
i = 0
j = 0
cnt = 0



for i in range(b - a + 1):
    
    
    for j in range(len(str(a))):
        a_rev = a_rev + str(a)[len(str(a)) - 1 - j]   

    if str(a_rev) == str(a):
        cnt+=1

    else:
        pass
    a+=1
    a_rev =""
    
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):
from statistics import mean, median,variance,stdev
import sys
import math
import fractions

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())





a,b= (int(i) for i in input().split())      








l = []
for x in range(10):
    for y in range(10):
        for z in range(10):
            l.append([str(z)])
            l.append([str(z),str(z)])
            l.append([str(y),str(z),str(y)])
            l.append([str(y),str(z),str(z),str(y)])
            l.append([str(x),str(y),str(z),str(y),str(x)])
clist = []

for i in range(len(l)):
    d  = l[i]
    e = ''.join(d)
    clist.append(e)
c = set(clist)
l = list(c)
s = 0
for i in range(len(l)):
    if a <= int(l[i]) and int(l[i]) <= b: s+=1
print(s)

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

Solution (Python):
A, B = map(int, input().split())
ans = 0
for i in range(A, B+1):
    s = []
    for _ in [0]*5:
        s.append(i % 10)
        i //= 10
    if s[0] == s[4] and s[1] == s[3]:
        ans += 1
print(ans)

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

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

print(count)

Solution (Python):
""" AtCoder """

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

ans = 0

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

print(ans)

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

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

Solution (Python):

import sys

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

def getAns(a, b) :
    cnt = 0
    for x in range(a, b + 1) :
        L = [0] * 5
        wkX = x
        for _ in range(0, 5) :
            L[_] = wkX % 10
            wkX = wkX // 10
        if L[0] == L[4] and L[1] == L[3] :
            cnt += 1
    return cnt

print(getAns(A, B))

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

res = 0

for i in range(10):
    for j in range(10):
        for k in range(10):
            cand = int(''.join([str(i), str(j), str(k), str(j), str(i)]))
            if A <= cand <= B:
                res += 1

print(res)

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

cunt = 0
if not 10000 <= A <= B <= 99999:
    print(0)
    sys.exit(0)
for i in range(A,B+1):
    sita = list(str(i))
    ue = sita[::-1]

    if sita == ue:
        cunt += 1

print(cunt)

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())
n=b-a
count=0
for i in range(n+1):
    t=a+i
    c=t%10
    d=(t%100-c)//10
    e=(t%1000-t%100)//100
    f=(t%10000-t%1000)//1000
    g=(t%100000-t%10000)//10000
    if(c==g and d==f):
        count+=1
    else:
        continue
print(count)

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())
S=0
for I in range(A,B+1):
	Q=str(I)
	R=Q[::-1]
	if R==Q:
		S+=1
print(S)

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

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

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

Solution (Python):

def getIntList(): return [int(x) for x in input().split()]
def db(x): 
    global debug
    if debug: print(x)
debug = False
def getDigitList(n):
    list = []
    while n>0:
        list.append(n%10)
        n //= 10
    return list

A,B = getIntList()
db((A,B))
cnt = 0
for i in range(A,B+1):
    x = getDigitList(i)
    
    for j in range(len(x)//2):
        
        if x[j]!=x[-j-1]: break
    else: 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())
cnt = 0
for number in range(a,b+1):
    if str(number) == str(number)[::-1]:
        cnt += 1

print(cnt)

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

while(True):
  s = i % 10 
  t = i // 10 % 10 
  u = i // 100 % 10 
  v = i // 1000 % 10 
  w = i // 10000 % 10 
  if (s==w and t==v):
    count += 1
  if B==i:
    break
  i += 1
print(count)

Solution (Python):
A,B = map(int,input().split())
count = 0
i = A
while(True):
  s = i % 10
  t = i // 10000 % 10
  u = i // 10 % 10
  v = i // 1000 % 10
  if (s==t and u==v):
    count += 1
  if B==i:
    break
  i += 1
print(count)

Solution (Python):
def check(n):
    s = str(n)
    if s == s[::-1]:
        return True
    else:
        return False

def main():
    x, y = map(int, input().split())

    ans = 0
    for i in range(x, y + 1):
        if check(i):
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
A,B = map(int,input().split())
kaibun = [i*100 + (i//10-(i//100)*10)*10+i//100 for i in range(100,1000)]
print(len([kaibun[i] for i in range(900) if A <= kaibun[i] <= B]))

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

print(ans)

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

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

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

count = 0
for i in range(a, b + 1):
    str_i = str(i)
    half_size = int(len(str_i) / 2)
    is_palindromic = True
    for j in range(half_size):
        front = j
        back = -j - 1
        if str_i[front] != str_i[back]:
            is_palindromic = False
            break
    if is_palindromic:
        count += 1
print(count)

Solution (Python):
s = input().split()
sa,sb = s[0],s[1]
a,b = int(sa),int(sb)
ap = int(sa[0]+sa[1]+sa[2]+sa[1]+sa[0])
bp = int(sb[0]+sb[1]+sb[2]+sb[1]+sb[0])
da = int(a/100)
db = int(b/100)
if ap < a:
    da += 1
if b < bp:
    db -= 1

print(db-da + 1)

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

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

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



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

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

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