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

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

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

Solution (Python):


def is_palindrome(sn):
    return sn[0] == sn[4] and sn[1] == sn[3]

a, b = map(int, input().split())
res = 0
for n in range(a, b + 1):
    sn = "%5d" % n
    if is_palindrome(sn):
        res += 1

print(res)

Solution (Python):
l = input().split()
A = int(l[0])
B = int(l[1])

cnt = 0
for i in range(A, B + 1):
	S = str(i)
	ok = True
	for j in range(0, 3):
		if S[j] != S[4 - j]:
			ok = False
			break

	if ok:
		cnt = cnt + 1

print(cnt)

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

while a<=b:
    c=str(a)
    if c[0]==c[4]:
        if c[1]==c[3]:
            k+=1
    a+=1
    
print(k)

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

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

rot_num = 0

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

    if i_str == i_str[::-1]:
        rot_num += 1

print(rot_num)

Solution (Python):
import math

a=input().rstrip().split(" ")

sum=0
for i in range( int(a[0]) , int( a[1] ) + 1 ,1  ):
    if(math.floor(i/10000) == i%10 and math.floor(i/1000)%10 == math.floor(i%100/10)):
        sum=sum+1

print(sum)

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

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

Solution (Python):

a, b = map(int, input().split(' '))
count = 0
for first in range(10):
    for second in range(10):
        for third in range(10):
            loop_num = first * 10001 + second * 1010 + third * 100
            if a <= loop_num <= b:
                count += 1
print(count)

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

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

Solution (Python):


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

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

Solution (Python):


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

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

print(n)

Solution (Python):
a, b = (int(i) for i in input().split())
ans = 0
for i in range(a,b+1):
    s = str(i)
    pv = len(s)//2
    rs = s[::-1]
    if not(len(s)%2==0) and s[:pv]==rs[:pv]:
        ans += 1
    elif len(s)%2==0 and s[:pv]==rs[:pv]:
        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 = map(int, input().split())
N = 0
 
for i in range(A, B + 1):
  str_n = str(i)
  if str_n == str_n[::-1]:
    N += 1
 
print(N)

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

Solution (Python):
def is_palindromic(x):
    s = str(x)
    left = 0
    right = len(s) - 1
    while (left < right):
        if (s[left] != s[right]):
            return False
        left += 1
        right -= 1
    return True
    
if __name__ == "__main__":
    A,B = map(int, input().split())
    result = 0
    for x in range(A, B + 1):
        if is_palindromic(x):
            result += 1
    print (result)

Solution (Python):
start, end = [int(i) for i in input().split()]

print(len([i for i in range(start, end + 1) if str(i) == str(i)[::-1]]))

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

print(count)

Solution (Python):
def to_list(num):
    ret = []
    while num != 0:
        ret.append(num % 10)
        num /= 10
    return ret[::-1]


def is_palindromic(lnum):
    return lnum[0] == lnum[-1] and lnum[1] == lnum[-2]


def increment(lnum):
    if lnum[2] < 9:
        lnum[2] += 1
    elif lnum[1] < 9:
        lnum[1] += 1
        lnum[-2] += 1
        lnum[2] = 0
    else:
        lnum[0] += 1
        lnum[-1] += 1
        lnum[1] = 0
        lnum[-2] = 0
        lnum[2] = 0
    return lnum


def find_first(lnum):
    orig = lnum[::]
    lnum[-1] = lnum[0]
    lnum[-2] = lnum[1]

    while lnum < orig:
        lnum = increment(lnum)

    return lnum


def solve(low, high):
    llow, lhigh = map(to_list, (low, high))
    if not is_palindromic(llow):
        llow = find_first(llow)


    total = 0
    while llow <= lhigh:
        total += 1
        llow = increment(llow)

    return total


def main():
    low, high = map(int, raw_input().strip().split())
    print solve(low, high)


main()

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

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

Solution (Python):
a,b = map(int,input().split())
c = b // 100 - a // 100
d = (a // 1000) % 10
e = a // 10000
f = a % 100
g = b % 100
h = (b // 1000) % 10
i = b // 10000
if 10 * d + e < f and (10 * h + i) <= g :
	print(c)
elif 10 * d + e < f and not 10 * h + i <= g :
	print(c - 1)
elif not 10 * d + e < f and 10 * h + i <= g :
	print(c + 1)
else:
	print(c)

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


if __name__ == '__main__':
    main()

Solution (Python):




import math


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

result = 0

for i in range(A, B + 1):
    string    = str(i)
    list_flag = [string[j] == string[-j - 1] for j in range(math.ceil(len(string) / 2))]
    if (len(list_flag) == sum(list_flag)):
        result += 1

print(result)

Solution (Python):
import numpy as np

n, m = list(map(int, input().split()))
a = 0

for i in range(n, m + 1, 1):
    if i // 10000 == i % 10 and (i // 1000) % 10 == (i // 10) % 10:
        a += 1

print(a)

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

ans = 0
for x in range(A, B + 1):
    s = str(x)
    if s == "".join(reversed(list(s))):
        ans += 1
print(ans)

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

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

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

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

Solution (Python):
data = input("")
data = data.split(" ")
sum = 0

for i in range(int(data[0]), int(data[1])+1):
    if str(i) == str(i)[::-1]:
            sum += 1
print(sum)

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

Solution (Python):


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

Solution (Python):

start, end = map(int, input().split())

count=0
value = start
while value <= end:
  if value // 10000 == value % 10 and value // 1000 % 10 == value % 100 // 10:
    count += 1
  value += 1

print( count )

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

Solution (Python):
T=(input()).split(' ')
A=T[0]
C=T[1]
result=0

for i in range(0,(int(C)-int(A)+1)):
    s1=(str(int(A)+i))[0:2]
    s2=((str(int(A)+i))[3:5])[::-1]
    
    if s1==s2:
        result=result+1
print(result)

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

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

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

if __name__ == '__main__':
    main()

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

print(count)

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


if __name__ == '__main__':
    main()

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

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

print(count)

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

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

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

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

    if s == r:
        c += 1

print(c)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a,b = LI()
    r = 0
    for i in range(a,b+1):
        s = str(i)
        if s == s[::-1]:
            r += 1

    return r


print(main())

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

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

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

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

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

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

print(ans)

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

count = 0

for i in range(a, b + 1):
    work_i = i
    n = 1
    while work_i >= 10:
        n += 1
        work_i = int(work_i / 10)

    flag = True
    for j in range(int(n/2)):
        if int(i / 10**j) % 10 != int(i / 10**(n-j-1)) % 10:
            flag = False

    if flag:
        count += 1

print(count)

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

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

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

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

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

print(counts)

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

def ip(n):
  r = list(str(n))
  r.reverse()
  return r == list(str(n))

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

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

solve()

Solution (Python):
def iscyclic(n):
    l = [int(x) for x in list(str(n))]
    N = len(l)
    if N % 2 == 0:
        return False
    else:
        n = N / 2
        for i in range(0, n):
            a = l[i]
            b = l[N - (i + 1)]
            if a != b:
                return False
        return True


def cyclicnum(a, b):
    res = []
    for i in range(a, b + 1):
        if iscyclic(i):
            res.append(i)
    return res

A, B = map(int, raw_input().split(" "))

print len(cyclicnum(A, B))

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

def isAnagram(num):
    n = list(str(num))
    r = list(reversed(str(num)))
    t = 0
    for i in range(len(n)):
        t += 0 if n[i] == r[i] else 1
    return 1 if t == 0 else 0

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

print(cnt)

Solution (Python):
AB = list(map(int, input().split())) 
A = AB[0]
B = AB[1]
count = 0
for i in range(A,B+1):
	a = int(i / 10000) 
	b = int(i / 1000 % 10)
	c = int(i / 10 % 10)
	d = int(i % 10)
	if ( a== d and b == c):
		count += 1

print(count)

Solution (Python):

if __name__ == "__main__":
    a, b = map(int, input().split())
    ans = 0
    for num in range(a, b+1):
        if str(num) == str(num)[::-1]:
            ans += 1
        else:
            pass
    print(ans)

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

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

print(counter)

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

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

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

Solution (Python):
def check_num(n):
	a=list(n)
	b=list(n)
	a.reverse()
	if a==b:
		return True
	else:
		return False
num=[x for x in input().split()]
A=int(num[0])
B=int(num[1])
cnt=0
for i in range(A,B+1):
	if check_num(str(i)):
		cnt+=1
	else:
		continue
print(cnt)

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

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

print(count)

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

palindrome()
print(cnt)

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

Solution (Python):

"""
B - Palindromic Numbers
https://beta.atcoder.jp/contests/abc090/tasks/abc090_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(A, B):
    ans = 0
    for i in range(A, B+1):
        s1 = str(i)
        s2 = s1[::-1]
        if s1 == s2:
            ans += 1
    return ans


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)

if __name__ == '__main__':
    main(sys.argv[1:])

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

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

Solution (Python):
a,b=map(int,input().split());print(len([1 for i in range(a,b+1)if i//1000==i%10*10+i%100//10]))

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 x in range(a,b+1):
    s = str(x)
    if s == ''.join(reversed(s)):
        ans += 1

print(ans)

Solution (Python):
A,B = map(int,input().split())
 
def kaibun(m, n):
    key = 0
    for i in range(m,n+1):
        s = i//10000  
        t = i%10
        u = i//1000 % 10
        v = i//10 % 10
        if (s==t)&(u==v):
            key += 1
    return key
 
print(kaibun(A,B))

Solution (Python):
a,b=map(int,input().split())
s=0
for i in range(a,b+1):
	j=str(i)
	l=len(j)
	m=0
	for k in range(l//2+1):
		if(j[k]!=j[l-k-1]):
			m=1
			break
			
	if(m==0):
		s+=1
print(s)

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

print(count)

Solution (Python):
Tmp = []
Tmp  = input().rstrip().split(' ')

A = int(Tmp[0])
B = int(Tmp[1])

Ans = 0
Data = A
while Data <= B:
    C = Data // 10000
    D = (Data - C * 10000 )// 1000
    E = Data // 100
    F = (Data - E * 100 )// 10
    G = Data % 10
    if (C==G) and (D==F):
        Ans += 1    
    Data += 1 

print(Ans)

Solution (Python):
A,B= map(int,input().split(" "))
count = 0
x = int(A/10**4)
y = int(A/10**3) - x*10
z = int(A/10**2) - x*10**2 - y*10
N = A
while N <= B:
    while y < 10:
        while z < 10:
                    N = x*(10**4)+y*(10**3)+z*(10**2)+y*(10**1)+x
                    if N > B:
                        break
                    if N == B:
                        count = count + 1
                        break
                    if N < A:
                        count = count -1
                    count = count + 1
                    z = z + 1
        z = 0
        y = y + 1
        if N >= B:
            break
    x = x + 1
    y = 0
print(count)

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

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

main()

Solution (Python):
AB = input().split()
A, B = int(AB[0]), int(AB[1])
a, b = 0, 0
rA, rB  = AB[0][:3]+AB[0][1]+AB[0][0], AB[1][:3]+AB[1][1]+AB[1][0]
ans = 0

if A <= int(rA):
    a = 1
if B < int(rB):
    b = 1
ans = (int(str(B)[0:3])-b)-(int(str(A)[0:3])-a)
print(ans)

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

num=0

for x in range(A,B+1):
 c1=x/10000
 c2=x/1000
 c3=x/100
 c4=x/10
 c5=x
 a1=c1
 a2=c2-c1*10
 a3=c3-c2*10
 a4=c4-c3*10
 a5=c5-c4*10
 if a1==a5 and a2==a4:
  num=num+1

print num

Solution (Python):


def check_circle(s):
    x = str(s)
    flag = True
    for i in range(int(len(x) / 2)):
         if x[i] != x[-1 * (i + 1)]:
              flag = False
    return flag

def solve(A, B):
    count = 0
    for y in range(A, B + 1):
        if check_circle(y):
            count += 1

    return count

def main():
    A, B = input().split(' ')
    print(solve(int(A), int(B)))


if __name__ == '__main__':
    main()

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

print(count)

Solution (Python):
lis = list(map(int, input().split()))
count = 0
for i in range(lis[0], lis[1]+1):
    str_ = list(str(i))
    if str_[0] == str_[4]:
        if str_[1] == str_[3]:
            count += 1
print(count)

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

c = int(a[:3])
if int(a[1::-1]) < int(a[3:]):
    c += 1

d = int(b[:3])
if int(b[1::-1]) > int(b[3:]):
    d -= 1

print(d - c + 1)

Solution (Python):
def rep(n):
    n=str(n)
    l=len(n)
    for i in range (0,l//2+1):
        if n[i]!=n[l-i-1]:
            return False
    return True

A,B=map(int,input().split(' '))
count = 0
for i in range(A,B+1):
    if rep(i):
        count += 1
print(count)

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

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

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

Solution (Python):

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

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

A = inp[0]
B = inp[1] + 1
ans = 0
for i in range(A, B):

  if str(i)[0:1] == str(i)[4:] :
    if str(i)[1:2] == str(i)[3:4] :
      ans += 1

print (ans)

Solution (Python):
n = input().split()
dis = int(n[1]) - int(n[0])
cnt = 0
for i in range(dis+1):
    nm = str(i + int(n[0]))
    if nm[0] == nm[-1]:
        if nm[1] == nm[-2]:
            cnt += 1

print(cnt)

Solution (Python):


in1 = input().split()

in1 = [int(i) for i in in1]
cnt = 0

for i in range(in1[0],in1[1]+1):
    a = i%10
    b = int((i/10)%10)
    c = int(i/100)%10
    d = int(i/1000)%10
    e = int(i/10000)

    if(a==e and b==d):
        cnt += 1
print(cnt)

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


n1, n2 = map(int, input().split())

l1 = [int(x) for x in list(str(n1))]
l2 = [int(x) for x in list(str(n2))]

n1Low = n1%100
n2Low = n2%100

n1HighRev = int(str(l1[1])+str(l1[0]))
n2HighRev = int(str(l2[1])+str(l2[0]))

ans = 0

if n1Low <= n1HighRev:
    ans += 1
if n2Low >= n2HighRev:
    ans += 1

if l1[0] != l2[0]:
    ans += 9 - l1[2] + l2[2]
    ans += (l2[0] - l1[0] - 1) * 100
    ans += (9 - l1[1] + l2[1]) * 10
else:
    if l1[1] != l2[1]:
        ans += 9 - l1[2] + l2[2]
        ans += (l2[1] - l1[1] - 1) * 10
    else:
        ans += l2[2] - l1[2]-1
print(ans)

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

Solution (Python):
STR = input().split()


IN1 = STR[0]
IN2 = STR[1]
IN1a = int(IN1)
IN2a = int(IN2)




length = IN2a - IN1a + 1





out = 0
for i in range(length):
    IN1s = [int(x) for x in list(str(IN1a))]
    IN2s = [int(x) for x in list(str(IN2a))]
    if IN1s[0] == IN1s[4] and IN1s[1] == IN1s[3]:
        IN1a += 1
        out += 1
    else:
        IN1a += 1
        i += 1

print(out)

Solution (Python):


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

ct = 0
for i in range(a, b+1):
  if(int(i/10000) == i%10 and int((i/1000)%10) == int((i/10)%10)):
    ct += 1

print(ct)

Solution (Python):

def main():
	A, B =  map(int, input().split())

	ans = 0

	for n in range(A,B+1):
		dic = {}
		count = 0
		n = str(n)

		if n[0] == n[4]:
			if n[1] == n[3]:
				ans += 1

	print (ans)

"""			
			if a not in dic.keys():
				dic.update({a:1})
			else:
				val = dic.get(a)
				val += 1
				dic.update({a:val})
				count += 1

		if count ==3:
			ans += 1

		if (len(dic.keys())) == 3 and count ==2:
			ans += 1

		if n == 11111:
			print (count)
"""

if __name__ == "__main__":
    
    
    main()

Solution (Python):


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


_list = list(range(A, B+1))
count = 0
buff = 0
for elm in _list:
    buff = 0
    m = str(elm)
    _len = len(m) - 1
    for i in range(3):
        if m[i] == m[4-i]:
            buff += 1
    if buff >= 3:
        count += 1



print(count)

Solution (Python):
c = int()
li = map(int, raw_input().split(" "))
for i in range(li[0],li[1]+1):
    c = c+1 if str(i) == str(i)[::-1] else c
print c

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

Solution (Python):
a = raw_input()
l = a.split()
A = l[0]
B = l[1]
ans = 0


if int(A) == int(B):
  ans = 1

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

Solution (Python):
a, b = map(int, input().split())
cnt=0
for i in range(a,b+1):
    i_lst=[]
    i_lst.append(str(i%10))
    i_lst.append(str(int((i%100)/10)))
    i_lst.append(str(int((i%1000)/100)))
    i_lst.append(str(int((i%10000)/1000)))
    i_lst.append(str(int((i%100000)/10000)))
    i_rvs=list(i_lst)
    i_lst.reverse()

    if(i_lst==i_rvs):
        cnt+=1
print(cnt)

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

kaibun_cnt = 0
while A <= B:
    num_to_str = str(A)
    if (num_to_str[0] == num_to_str[4]) and (num_to_str[1] == num_to_str[3]):
        kaibun_cnt += 1
    A += 1

print(kaibun_cnt)

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

Solution (Python):
def is_palindrome(num):
    return str(num) == str(num)[::-1]

a, b = map(lambda x: int(x) , input().split())
count = 0
for i in range(a, b + 1):
    if is_palindrome(i):
        count += 1
print(count)

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

print(cnt)

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

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

Solution (Python):


a,b = input().split()
A = int(a)
B = int(b)

def judge(n):
    J = 0
    s = str(n)
    if s == s[::-1]:
        J = 1
    else:
        pass
    return J

num = 0
for i in range(A,B+1):
    j = 0
    j = judge(i)
    if j == 1:
        num += 1
    else:
        pass

print(num)

Solution (Python):
A,B = map(int,input().split())
count =0
for i in range(A,B+1):
    a1 = i - (i // 10) * 10
    a5 = i // 10000
    a2 = ((i - ((i // 100) * 100)) - a1) // 10
    a4 = i // 1000 - (i // 10000) * 10
    if a1 == a5 and a2 == a4:
        count += 1
print(count)

Solution (Python):
A = input().split(" ")

B = int(A[0])
C = int(A[1])
Blis = list(A[0])
Clis = list(A[1])





NUM = B
kazu = 0
while NUM <= C:
    NUMlis = list(str(NUM))
    if NUMlis[0] == NUMlis[4] and NUMlis[1] == NUMlis[3]:
        kazu += 1
    NUM += 1
print(kazu)

Solution (Python):
l = input().split()

a = int(l[0])
b = int(l[1])
palindrome = 0
for num in range(a,b+1):

    num = str(num)
    cnt = 0

    for i in range(2):
        if num[i] == num[4-i]:
            cnt += 1
    if cnt == 2:
        palindrome += 1

print(palindrome)

Solution (Python):
def palindrome(string): return 1 if string==string[::-1] else 0

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

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

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

    if List_p == List_m:
        ans += 1

print(ans)

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


print(p)

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


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

print(ans)

Solution (Python):
counter = 0
c = list(map(int, input().split(' ')))
for i in range(c[0], c[1] + 1):
  if str(i)[0] != str(i)[4]:
    continue
  if str(i)[1] != str(i)[3]:
    continue
  counter += 1

print(counter)

Solution (Python):

a = map(int, raw_input().split())
b = a[0]
c = []
while b <= a[1]:
    one = str(b)
    two = str(one[4])+str(one[3])+str(one[2])+str(one[1])+str(one[0])
    if one == two:
        c.append(one)
    b += 1
print len(c)

Solution (Python):
a = input()
a = a.split(' ')
A = eval(a[0])
B = eval(a[1])
k = 0
for i in range(A, B + 1, 1):
    l = str(i)
    ok = False
    for j in range(len(l) // 2):
        if l[j] != l[len(l) - 1 - j]:
            ok = True
            break
    if not ok:
        k = k + 1
print(k)

Solution (Python):
A, B = map(int, input().split())
cand = [i*(10**4) + j*(10**3) + k*(10**2) + j*10 + i for i in range(1, 10) for j in range(0, 10) for k in range(0, 10)]

count = 0
for c in cand:
    if c >= A and c <= B:
        count += 1
        
print(count)

Solution (Python):
if __name__ == "__main__":
    A, B = list(map(int, (input().split(' '))))
    cnt = 0
    for i in range(A, B+1):
        buf = str(i)
        if buf[0] == buf[4] and buf[1] == buf[3]:
            cnt += 1
    print(cnt)

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

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

print(result)

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

c = 0
for i in range(A,B+1):
	c += (i % 10 == (i - i % 10000)/10000)*(((i % 10000)-(i%1000))/1000 == (i%100 - i % 10)/10)

print(c)

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