object Main extends App {
  import scala.io.StdIn._
  val c = readInt()
  println(
    c match {
      case _ if (65 to 90).contains(c) ⇒ 1
      case _ if (97 to 122).contains(c) ⇒ 2
      case _ ⇒ 0
    }
  )
}

