import java.util.Scanner
import java.io.PrintWriter

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val pw = new PrintWriter(System.out)

    val s = sc.next()
    s match {
      case "SUN" => pw.println(7)
      case "MON" => pw.println(6)
      case "TUE" => pw.println(5)
      case "WED" => pw.println(4)
      case "THU" => pw.println(3)
      case "FRI" => pw.println(2)
      case "SAT" => pw.println(1)
    }


    pw.flush()
  }
}