main = do
  [a,b] <- map read . words <$> getLine
  let v = [x | x <- [1,a..1000], x < b]
  print (len v)

len :: [Int] -> Int
len x
  | x == [] = 0
  | tail x == [] = 1
  | otherwise = 1 + len (tail x)
