object Main {
  val days = List("SUN", "MON" ,"TUE", "WED", "THU", "FRI", "SAT")
  def main(args: Array[String]): Unit = {
    val result = solve(io.Source.stdin.getLines().toList.head)
    println(result)
  }
  def solve(s: String): Int = {
    7 - days.indexOf(s)
  }
}