function Main(input){
  input = input.split(' ');
  var a = Number(input[0]);
  var b = Number(input[1]);

  var time = a + b;
  if(time <= 23) {
      console.log(time);
  } else {
      console.log( time - 24 );
  }

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