function Main(input) {
    var youbi = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
     var index = youbi.findIndex(e=>{
        return e==input
    })

    console.log(""+7-index);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8")); 