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

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

cnt = 0
for i in range(a, b+1):
    tmp = str(i)
    if tmp == tmp[::-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)
  n=len(s)
  j=True
  for x in range(n//2):
    if s[x]!=s[-1-x]:
      j=False
      
  if j:
    ans+=1
    
print(ans)

Solution (Python):
import numpy as np


def split_digits(n):
  digits = []
  while n > 0:
    digits.append(n % 10)
    n = int(n / 10)
  return digits


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

for i in range(a, b + 1):
  digits = np.array(split_digits(i))
  if (digits == digits[::-1]).all():
    c += 1
    
print(c)

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

Solution (Python):
A, B = map(int, input().split())
 
ans = 0
 
while A<=B :
  if str(A)==str(A)[::-1]:
    ans = ans + 1
  else:
    ans = ans
  A = A + 1
 
print(ans)

Solution (Python):









import sys
input = sys.stdin.readline

A, B = map(int, input().split())
n = 0
i = A
while i <= B:
    L = list(str(i))
    if L[0] == L[4] and L[1] == L[3]:
        n += 1
    i += 1
print(n)

Solution (Python):
a,b = map(int,input().split())
cnt = 0
import math

for i in range(a,b+1):
    if i%10 == math.floor(i/10000)%10 and math.floor(i/10)%10 == math.floor(i/1000)%10:
        cnt = cnt + 1
        
print(cnt)

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

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

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

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

cnt = 0
for i in range(A, B + 1):
    s = str(i)
    l = 0
    r = len(s) - 1
    while l < r and s[l] == s[r]:
        l += 1
        r -= 1
    if l >= r:
        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==s[::-1]:
        ans+=1
print(ans)

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

Solution (Python):











N,K= map(int,input().split())


c=0
for i in range(N,K+1):
    i=list(str(i))
    j=list(reversed(i))
    if i==j:
        c+=1
print(c)

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

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

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

Solution (Python):
x,y=map(int, input().split())
cnt=0
for i in range(9):
	for j in range(10):
		for k in range(10):
			a=10001*(i+1)+100*k+1010*j
			if y>=a>=x:
				cnt+=1
print(cnt)

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

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

print(ans)

Solution (Python):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

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

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):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

a,b = inpl()
res = 0
for x in range(a,b+1):
    tmp = str(x)
    if tmp == tmp[::-1]:
        res += 1
print(res)

Solution (Python):
def is_palindromic(N):
    N_reversed=list(str(N))
    N_reversed.reverse()
    N_reversed=int(''.join(N_reversed))
    if N_reversed==N:
        return True
    else:
        return False
A,B=map(int,input().split())
count=0
for i in range(A,B+1):
    if is_palindromic(i):
        count+=1
print(count)

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):
            num = int(str(i) + str(j) + str(k) + str(j) + str(i))
            if A <= num <= B:
                count += 1
print(count)

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

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

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

A,B = I()
ans = 0
for i in range(A,B+1):
    F = 1
    s = str(i)
    for i in range(2):
        if s[i] != s[4-i]:
            F = 0
    if F == 1:
        ans += 1
print(ans)

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):
def kaibu(n):
    if str(n) == str(n)[::-1]:
        return True
    return False

def solve():
    a, b = map(int, input().split())
    ans = 0
    for i in range(a, b+1):
        if kaibu(i) == True:
            ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    solve()

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




def is_cycle(x):
    x = str(x)
    return x == x[::-1]


ans = 0
for x in range(A, B + 1):
    ans += is_cycle(x)
print(ans)

Solution (Python):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

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

print(ans)

Solution (Python):
def checkpalindrome(n):
  s=str(n)
  a=[]
  for i in range(len(s)):
    a.append(s[i])
  a.reverse()
  if ''.join(a)==s:
    return 1
  else:
    return 0
a,b=map(int,input().split())
ans=0
for i in range(a,b+1):
  ans+=checkpalindrome(i)
print(ans)

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

A, B = mapint()

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

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

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

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

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

ans = 0
for i in range(a, b + 1):
    s = str(i)
    flag = False
    for i in range(len(s)):
        if s[i] != s[len(s) - i - 1]:
            flag = True
    if not flag:
        ans += 1
print(ans)

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

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

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

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

Solution (Python):

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


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

print(cnt)

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

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

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

Solution (Python):
def resolve():
    allPt = []
    for i in range(1, 10):
        for j in range(10):
            for k in range(10):
                allPt.append(int(str(i) + str(j) + str(k) + str(j) + str(i)))
    A, B = [int(i) for i in input().split()]
    cnt = 0
    for i in allPt:
        if A <= i and i <= B:
            cnt += 1
    print(cnt)


resolve()

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

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

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

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

Solution (Python):
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a, b = map(int, input().split())
for i in range(a, b+1):
    num_str = str(i)
    chk = ''.join(list(reversed(num_str)))
    if num_str == chk:
        ans += 1
print(ans)

Solution (Python):
def f(x):
    l = len(x)
    i = 0
    while x[i] == x[l-i-1]:
        i += 1
        if i > (l//2):
            return True
            break
    return False

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

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

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

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
answer = sum(str(x) == str(x)[::-1] for x in range(A, B+1))
print(answer)

Solution (Python):
a, b  = map(int, input().split())
count = 0
for i in range(b):
  temp = a + i
  if temp > b:
    break
  li = []
  ni = temp
  for p in range(4):
    li.append(ni // (10 ** (4 - p)))
    ni = ni % (10 ** (4 - p))
  li.append(ni % 10)
  if li == li[::-1]:
    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())
n = b - a + 1
count = 0

for i in range(n):
  x = a + i
  xx = list(str(x))
  xx.reverse()
  xx = int("".join(xx))
  if x == xx:
    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::-1]:
        ans += 1
print(ans)

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

anum = int(a)
bnum = int(b)





for i in range(anum,bnum+1):
    stra = str(i)
    if stra == stra[::-1]:        
        count += 1
        
print(count)

Solution (Python):

import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left 
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

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

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

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

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

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

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

print(ans)

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

Solution (Python):


def judge(k):
    n = str(k)
    return n[0] == n[4] and n[1] == n[3]

def solve(a,b):
    c = 0
    for i in range(a,b+1):
        if judge(i):
            c += 1
    return c 

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

if __name__ == '__main__':
    main()

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

Solution (Python):


def judge(k):
    n = str(k)
    return n[0] == n[4] and n[1] == n[3]

def solve(a,b):
    c = 0
    for i in range(a,b+1):
        if judge(i):
            c += 1
    return c 

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

if __name__ == '__main__':
    main()

Solution (Python):
n,m = map(int,input().split())

def judge (x):
    if x[0] == x[4] and x[1] == x[3]:
        return True
    else:
        return False

ans = 0
for i in range(n,m+1):
    if judge(str(i)):
        ans += 1

print (ans)

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

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

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

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

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

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

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

Solution (Python):





def main():
    A,B=map(int,input().split())
    cnt=0
    for i in range(A,B+1):
        s=str(i)
        if s==s[::-1]:
            cnt+=1
    print(cnt)
    
if __name__=="__main__":
    main()

Solution (Python):
A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])
d=int(A[1])*10+int(A[0])
e=int(B[1])*10+int(B[0])
count_small=0
count_large=0
if a==b:
    for i in range(0,10):
        if a*1000+d+i*100>=int(A) and b*1000+e+i*100<=int(B):
            count_small+=1
    ans=count_small
else:
    for i in range(0,10):
        if a*1000+d+i*100>=int(A):
            count_small+=1
        if b*1000+e+i*100<=int(B):
            count_large+=1
    ans=(b-a-1)*10+count_small+count_large
print(ans)

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

Solution (Python):






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





ans = 0
for x in range(A,B+1):
    x = str(x)
    for i in range(len(x)//2):
        if x[i] != x[-(i+1)]:
            break
    else:
        ans += 1
print(ans)

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

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

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

print(result)

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

resolve()

Solution (Python):

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

def kaibun(n):
    flg = True
    for i in range(len(str(n))//2):
        if str(n)[i] != str(n)[-1-i]:
            flg = False
            break
            
    if flg:
        return True
    else:
        return False
    
cnt = 0
for i in range(a,b+1):
    if kaibun(i):
        cnt += 1
        
print(cnt)

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

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

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

Solution (Python):
A,B=map(int,input().split())
ans=0
for i in range(A,B+1):
  S=list(str(i))
  if S == S[::-1]:
    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[0] == i[4] and i[1] == i[3]:
    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):
def resolve():
    A, B = map(int, input().split())
    ans = 0
    for i in range(A, B+1):
        count = 0
        for j in range(len(str(i))):
            if str(i)[j] == str(i)[(j+1)*-1]:
                count += 1
        if count == len(str(i)):
            ans += 1
    print(ans)
resolve()

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

def ReverseDigits(n):
    d = str()
    for i in range(5):
        d += str(n % 10)
        n = n // 10
    return(d)

ans = 0

for i in range(A, B+1):
    if str(i) == ReverseDigits(i):
        ans += 1
    else:
        pass

print(ans)

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

count = 0
for i in range(a, b + 1):
    l = list(str(i))
    up = l[:(len(l) // 2)]
    if len(l) % 2 == 0:
        down = l[len(l) // 2:]
        down.reverse()
    else:
        down = l[(len(l) // 2) + 1:]
        down.reverse()
    if up == down:
        count += 1

print(count)

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

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

Solution (Python):
import math
from collections import deque
from collections import defaultdict


def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): 
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): 
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} 
def bitArr(n):
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): 
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	
	data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	
	ans = data[:]
	return ans

ans = 0
a,b = readInts()

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

print(ans)

Solution (Python):
def is_kaibun(n):
    ns = [int(v) for v in str(n)]

    i = 0
    j = len(ns) - 1
    while i < j:
        if ns[i] != ns[j]:
            return False
        i += 1
        j -= 1

    return True


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

count = 0
for i in range(A, B + 1):
    if is_kaibun(i):
        count += 1

print(count)

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

Solution (Python):
a,b = map(int,input().split())
c = str(a)
d = str(b)
e = 0
f = 0
if int(c[0]) + int(c[1]) * 10 >= int(c[3]) * 10 + int(c[4]):
    e = a // 100
else:
    e = a // 100 + 1
if int(d[0]) + int(d[1])*10 <= int(d[3])*10 + int(d[4]):
    f = b // 100
else:
    f = b // 100 - 1
print(f-e+1)

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

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

Solution (Python):
a, b = map(int, input().split())
def isr(si):
    for j in range(0, len(si)//2):
        if si[j] != si[-1-j]:
            return False
    return True

c = 0
for i in range(a, b+1):
    si = str(i)
    if isr(si):
        c += 1
print(c)

Solution (Python):
def main():
    A, B = map(int, input().split())
    cnt = 0
    for i in range(A, B+1):
        s = str(i)
        t = list(s)
        t.reverse()
        if s == ''.join(t):
            cnt += 1
    print(cnt)

if __name__ == "__main__":
    main()

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

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

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

print(ans)

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

print(count)

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

print(ans)

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

ans = 0

for i in range(1,10):
  for j in range(0,10):
    for k in range(0,10):
      num = [str(i),str(j),str(k),str(j),str(i)]
      
      if int(''.join(num)) >= a and int(''.join(num)) <= b:

        ans += 1
        
print(ans)

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

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

Solution (Python):
L = []
for i in range(1, 10):
    for j in range(0, 10):
        for k in range(0, 10):
            L.append(i * 10000 + j * 1000 + k * 100 + j * 10 + i)
a, b = map(int, input().split())
print(sum(i in L for i in range(a, b + 1)))

Solution (Python):
L = []
for i in range(1, 10):
    for j in range(0, 10):
        for k in range(0, 10):
            L.append(i * 10000 + j * 1000 + k * 100 + j * 10 + i)
a, b = map(int, input().split())

print(sum(a <= e <= b for e in L))

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

Solution (Python):
def main():
    a,b = map(int, input().split())
    c = [0, 0, 0, 0, 0]
    ans = 0

    for n in range(a,b+1):
        for i in range(5):
            c[i] = n % 10
            n = n // 10

        if (c[0]==c[4]) and (c[1]==c[3]):
            ans = ans + 1
    return ans

print(main())

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

Solution (Python):
import sys
import math
import itertools

def isLoop(s):
    if (s[0] == s[-1] and s[1] == s[-2]):
        return True
    else:
        return False
a, b = map(int, input().split())
ans=0
for i in range(a, b + 1):
    if (isLoop(str(i))):
        ans += 1
print(ans)

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

Solution (Python):
a, b = (int(i) for i in input().split())
cnt = 0
for i in range(a, b+1):
    s = str(i)
    bool = True
    for j in range(len(s)//2+1):
        if not s[j] == s[len(s)-1-j]:
            bool = False
            break
    if bool:
        cnt += 1
print(cnt)

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

Solution (Python):
def solve(n, m):

    ans = len([i for i in range(n, m+1) if str(i)[:2] == str(i)[-1:-3:-1]])
    return ans

if __name__ == "__main__":
    n, m = [int(i) for i in input().split()]
    print(solve(n, m))

Solution (Python):
import sys

input = sys.stdin.readline


def is_palindromic(s):
    if s[0] == s[-1] and s[1] == s[-2]:
        return True
    else:
        return False


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

    ans = 0
    for i in range(A, B + 1):
        ans += 1 if is_palindromic(str(i)) else 0

    print(ans)


if __name__ == "__main__":
    main()

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

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

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