fun main(args: Array<String>) {
  val S = readLine()!!
  val days = arrayOf("SUN","MON","TUE","WED","THU","FRI","SAT").reversed()
  for (i in days.indices) {
    if (days[i] == S) {
      println(i+1)
      break
    }      
  }
}