function main(input){
    const args=input.split(' ');
    var array=['SAT','FRI','THU','WED','TUE','MON','SUN'];
    var ans=array.indexOf(args[0])+1;
    console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));