import java.util.*;
public class Main {

	public static int main(String[] args) {
			  Scanner sc=new Scanner(System.in);
			  int t =Integer.parseInt(sc.next());
			  int a =Integer.parseInt(sc.next());
			  System.out.println((t+a)%24);
			return 0;
		
			 }
	}