import Control.Applicative
import Data.Char

main :: IO ()
main =  do 
    s <- getLine
    putStrLn $ show (solve s)

solve :: String -> Int 
solve s | s == "SUN" = 7
        | s == "MON" = 6
        | s == "TUE" = 5
        | s == "WED" = 4
        | s == "THU" = 3
        | s == "FRI" = 2
        | otherwise  = 1