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


    console.log(7-index);
}

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