import scala.io.StdIn._
import scala.runtime.ScalaRunTime._

object Main extends App {
  def var_dump(x:Any):Unit = {
    println(stringOf(x))
  }

  def readLineAndConvert[A](f:String=>A): Seq[A] = {
    readLine().split(" ").map(f)
  }
  
  val x = readLineAndConvert(_.toInt)
  println(x.sum % 24 )
}
