import java.util.Scanner;

fun main (args : Array<String>) {
  val input = Scanner(System.`in`)
  val dayOfWeek = arrayOf("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT")
  
  while (input.hasNext()) {
    val S = input.next()
    
    for (i in dayOfWeek.indices) {
      if (S.equals(dayOfWeek[i])) {
        println(7 - i)
      }
    }
  }
}