const arr = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];

function Main(input) {
  const inputs = input.split('\n')
    .filter(v => v);
  const i = arr.indexOf(inputs[0]);
  console.log((7 - i) + '\n');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));