import java.io.{BufferedReader, InputStreamReader}

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val day = in.readLine()

    System.out.println(
      day match {
        case "MON" => 6
        case "TUE" => 5
        case "WED" => 4
        case "THU" => 3
        case "FRI" => 2
        case "SAT" => 1
        case "SUN" => 7
      }
    )
  }
}
