function Main(input) {
  const array = input.split(' ').map(n => Number(n));
  const startTime = array[0] + array[1];
  if(startTime >= 24) {
    console.log(startTime - 24);
  } else {
    console.log(startTime);
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));