fun main (args : Array<String>) {
	val s = readLine()!!
	val S : String = s.toString()
	val list : List<String> = listOf("SUN","MON","TUE","WED","THU","FRI","SAT")
	val num = list.indexOfFirst{ it == S}
	println("${7 - num}")
}