object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val S = sc.next()
  val dayOfTheWeek = List("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT")
  val x :: xs = (dayOfTheWeek ++ dayOfTheWeek).dropWhile(_ != S)
  println(xs.takeWhile(_ != "SUN").length + 1)
}
