function main(arg) {
	arg = arg.trim();
	var day = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];
  	var out = day.indexOf(arg);
  	out = 7- out;
  console.log(out)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));