process.stdin.resume();
process.stdin.setEncoding('utf8');
 
var lines = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', (line) => {
    // ここで入力を処理する
    lines.push(line);
});
reader.on('close', () => {
    // ここで出力する
    for(var i =0; i<lines.length; i++){
      	switch(lines[i]){
    case 'SUN':
        console.log('7');
        break;
 
 
    case 'MON':
        console.log('6');
        break;
 
 
    case 'TUE':
        console.log('5');
        break;
    

    case 'WED':
        console.log('4');
        break;
 
 
    case 'THU':
        console.log('3');
        break;
 
 
    case 'FRI':
        console.log('2');
        break;


    case 'SAT':
        console.log('1');
        break;
	}
    }
});