function Main(input) {
    var S = input[0];

    var list = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];

    var index = list.indexOf(S);
    console.log(7 - index);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));