function Main(input) {
	input = input.trim();
	//input = input.trim().split(" ");
	//input = input.trim().split("\n");
	input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));
  	var a = input[0];
  	var b = input[1];
  if(a+b >= 24){
     console.log(a + b - 24);
     }else{
       console.log(a + b);
     }
}

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