import scala.io.StdIn._

object Main extends App {


  val s = readLine()

  def solve() = {
    val map = Map(
      "MON" -> 6,
      "TUE" -> 5,
      "WED" -> 4,
      "THU" -> 3,
      "FRI" -> 2,
      "SAT" -> 1,
      "SUN" -> 7
    )
    map(s)
  }

  println(solve())

}

