module Main where

import           Data.Maybe                     ( fromJust )
import qualified Data.ByteString.Char8         as BS


bytestr2Int = fst . fromJust . BS.readInteger
getInt = bytestr2Int <$> BS.getLine
getIntLH = map bytestr2Int . BS.words <$> BS.getLine
getIntLV n = replicate n $ getInt
getInt2D n = replicate n $ getIntLH


main :: IO ()
main = do
    w <- getLine
    print $ checkWeek w

checkWeek s | s == "SUN" = 7
            | s == "SAT" = 1
            | s == "FRI" = 2
            | s == "THU" = 3
            | s == "WED" = 4
            | s == "TUE" = 5
            | s == "MON" = 6
