fun main(arr:Array<String>) {
    val wd = listOf("SUN","MON","TUE","WED","THU","FRI","SAT").toMutableList()
    wd.addAll(wd)
    val s = readLine()!!
    val idx = wd.indexOf(s)
    val ans = wd.subList(idx+1, wd.lastIndex).indexOf("SUN") + 1
    println(ans)
}