import java.util.Scanner;public class JAVA { public static void main(String args[]) { Scanner time=new Scanner(System.in); int a,b; while(time.hasNext()) { a=time.nextInt(); b=a>=15?(a-15):(24-15+a); System.out.println(b); } }}