function main(input) {
  var times = input.split(" ");
  var time = Number(times[0]) + Number(times[1]);
  console.log((24 <= time) ? time - 24 : time);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
