process.stdin.resume()
process.stdin.setEncoding('utf8')

let inputLines = ''

const parseInt10 = (v) => {
  return parseInt(v, 10)
}

process.stdin.on('data', function (chunk) {
  inputLines += chunk
})

process.stdin.on('end', function () {
  const lines = inputLines.trim().split('\n')
  solve(lines)
})

const solve = (lines) => {
  const [a, b] = lines[0].split(' ').map(parseInt10)
  console.log((a + b) % 24)
}
