function main(input){
	const reverse = (s) => {
        return s.split('').reverse().join('');
    };

  const WEEK = ['SUN','MON','TUE','WED','THU','FRI','SAT'].map(reverse);
  const S = reverse(input.split('\n')[0]);

	var index = 0;
	for (var i=0 ; i<=WEEK.length ; i++) {
			if (WEEK[i] === S) {
              	index = 7-i
				console.log(index)
				break;
			}
	}

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));