var weekdays = new Map([['SUN',7],['MON',6],['TUE',5],['WED',4],['THU',3],['FRI',2],['SAT',1]]);

function check(target) {
  return weekdays.get(target);
}

function Main(inp) {
  var input = inp.split("\n");
  var target = input[0];

  console.log(check(target));
}

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