function main(input) {
  const args = input.split(' ').map(n => parseInt(n, 10));
  const A = args[0];
  const B = args[1];
  
  let t = A + B;
  
  if (t >= 24) {
    console.log(t % 24);
  } else {
    console.log(t);
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));