import java.io._
import java.math._
import java.security._
import java.text._
import java.util._
import java.util.concurrent._
import java.util.function._
import java.util.regex._
import java.util.stream._

val s = scala.io.StdIn.readLine.trim.toString
val weekDaysMap: Map[String, Int] = Map(
  "SUN" -> 0,
  "MON" -> 6,
  "TUE" -> 5,
  "WED" -> 4,
  "THU" -> 3,
  "FRI" -> 2,
  "SAT" -> 1
)
println(weekDaysMap[s])
