import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Control.Monad.ST
import Data.List
import Data.Array.ST
import Data.Array
import Data.Maybe (fromJust)


solve :: Int -> Int -> Int
solve a b = (a + b) `mod` 24


main :: IO ()
main = do
    (a:b:_) <- map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine
    print $ solve a b
