function main(input) {
   input = input.trim();
  const a = input.split(" ");
  const day = ["SAT","FRI","THU","WED","TUE","MON","SUN"];
	for(var i = 0; i < day.length; i++) {
		if(a[0]==day[i]) {
			console.log(i+1);
			break;
		}
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));