import std.stdio, std.conv, std.string, std.math, std.algorithm;

void main(){
	auto ip = readln.split.to!(int[]);
	if(ip[0] + ip[1] <= 24) (ip[0] + ip[1]).writeln;
	else (ip[0] + ip[1] - 24).writeln;
}