function main(input) {
  var n = input[0];
  console.log(
    [7,6,5,4,3,2,1][(["SUN","MON","TUE","WED","THU","FRI","SAT"].indexOf(n))]
  );
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))
