fun main(args : Array<String>) {
    var S = readString()

    when(S){
        "SUN"->{
            print(7)
        }
        "MON"->{
            print(6)
        }
        "TUE"->{
            print(5)
        }
        "WED"->{
            print(4)
        }
        "THU"->{
            print(3)
        }
        "FRI"->{
            print(2)
        }
        "SAT"->{
            print(1)
        }
    }
    return
}

fun readString() = readLine()!!