fun main(args: Array<String>) {
    val s         = readLine()!!.toString()
    val day = arrayOf("SUN", "MON", "TUE", "WED", "THU", "FRI")
    val ans = when {
        (s == day[0]) -> 7
        (s == day[1]) -> 6
        (s == day[2]) -> 5
        (s == day[3]) -> 4
        (s == day[4]) -> 3
        (s == day[5]) -> 2
        else          -> 1
    }
    println(ans)
}