import std.stdio, std.string, std.array, std.conv, std.algorithm, std.typecons, std.range, std.container, std.math, std.algorithm.searching, std.functional,std.mathspecial;

void main(){
    auto ab=readln.split.map!(to!int).array;
    writeln((a[0]+b[0])%24);
}
