function main(input){
    const args=input.split;
    const ans;
    if(args=="SUN"){
        ans=0;
    }else if(args=="MON"){
        ans=6;
    }else if(args=="TUE"){
        ans=5;
    }else if(args=="WED"){
        ans=4;
    }else if(args=="THU"){
        ans=3;
    }else if(args=="FRI"){
        ans=2;
    }else{
        ans=1;
    }
    console.log(ans);
}

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