#include<bits/stdc++.h>
using namespace std;
int main()
{
	int A,B,z;
	if(0<=A&&A<=23){
		if(0<=B&&B<=23)
		{
			scanf("%d%d",&A,&B);
			z=A+B;
			int f=z%24;
			printf("%d",f);
		}
		else
		{
			printf("Error");
		}	
	}
	else
	{
		printf("Error");
	}
	return 0;
}