
import Data.List
import Control.Monad
import Control.Applicative

digs :: Integral x => x -> [x]
digs 0 = []
digs x = digs (x `div` 10) ++ [x `mod` 10]

div10 :: Int -> Int -> Int
div10 a x =
  if x/=0 then div10 (div a  10) (x-1)
  else a

check :: Int -> Int -> Int
check m n =
  let x = length $ digs m in
  let y = div10 m (div x 2) in
  let x' = length $ digs n in
  let y' = div10 n (div x' 2) in
   abs $ y-y'

readInt = read :: String -> Int
  
main = do
  [a,b] <- map readInt.words <$> getLine
  let ans = check a b
  putStrLn $ show ans

