function Main(input) {
	const s = input.split("\n")[0];

    const next = {
   		"SUN": 7,
		"MON": 6,
      	"TUE": 5,
        "WED": 4,
        "THU": 3,
       	"FRI": 2,
    	"SAT": 1,
    }
	console.log(next[s]);
    
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
