function Main(input) {
  var chars = input.trim();

  var days = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
  
  var index = days.indexOf(chars);
  
  console.log(7 - index);
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));