object Main {
  def main(args:Array[String]) {
    val S = readLine()
    val weeklist = List("SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN")
    var ans = 0
    for(i <- 0 until weeklist.length) {
      if(S == weeklist(i)) ans = (i % 7) + 1
    }
    println(ans)
  }
}
