"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0];
    
    const array = ["SUN","MON","TUE","WED","THU","FRI","SAT"];
    
    if(S === "SUN") {
        console.log(7)   
    }
    
    if(S === "MON") {
        console.log(6)   
    }
    
    if(S === "TUE") {
        console.log(5)   
    }
    
    if(S === "WED") {
        console.log(4)   
    }
    
    if(S === "THU") {
        console.log(3)   
    }
    
    if(S === "FRI") {
        console.log(2)   
    }
    
    if(S === "SAT") {
        console.log(1)   
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));