import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
let A = Int(split[0])!
let B = Int(split[1])!

if (A+B<24){
    print(A+B)
}else{
    print(A+B-24)
}