import sys
from functools import lru_cache
sys.stdin = open('data.txt', 'r')
# 小于等于n的符合條件的數字個數
def get_num(n):
if n == 0:
return 1
arr = []
val = n
while val:
arr.append(val % 10)
val //= 10
# 前i位做選擇,更高的一位選擇數值是higher_val且更高的所有位都選擇了最大值的标志是all_higher_max的限制下,合法的數值的個數
@lru_cache(typed=False, maxsize=128000000)
def dp(i, higher_val, all_higer_max):
if i == 0:
low_bound, up_bound = higher_val, arr[i] if all_higer_max else 9
return max(0, up_bound - low_bound + 1)
else:
low_bound, up_bound = higher_val, arr[i] if all_higer_max else 9
if low_bound > up_bound:
return 0
ans = 0
for cur_val in range(low_bound, up_bound+1):
ans += dp(i-1, cur_val, all_higer_max and cur_val == arr[i])
return ans
return dp(len(arr)-1, 0, True)
while True:
try:
a, b = map(int, input().split())
except:
break
print( get_num(b) - get_num(a-1) )