fun main(args: Array<String>) {
    abc146a()
}

fun abc146a() {
    val s = readLine()!!

    val list = listOf("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT")
    val indexOf = list.indexOf(s)
    val answer = indexOf.let { if (it == 0) 7 else 7 - it }

    println(answer)
}
