main :: IO()
main = do
    str <- getLine
    print $ getsolve str
    
getsolve :: String -> Int
getsolve str
    | str == "SUN"			= 7
    | str == "MON"			= 6
    | str == "TUE"			= 5
    | str == "WED"			= 4
    | str == "THU"			= 3
    | str == "FRI"			= 2
    | str == "SAT"			= 1
    | otherwise				= 0