module Main (main) where

import qualified Data.ByteString.Char8 as C8
import Data.Maybe

main :: IO ()
main = readInts >>= print . solve

solve [a,b]
  | b == 1 = 0
  | otherwise = q + signum r
  where
    (q,r) = b `divMod` a

-- utils
readInts :: IO [Int]
readInts = map (fst . fromJust . C8.readInt) . C8.words <$> C8.getLine