function Main(input) {
    var youbi = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

    //input = input.split("\n")
    //input = input.map(e=>e.split(" "))
    //input = input.map(e=>e.map(f=>parseInt(f,10)))    
        
     var index = youbi.findIndex(e=>{
        return e==input
    })


    console.log(7-index);
}

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