import Data.List
import Data.Maybe

main = do
    s <- getLine
    putStrLn $ show $ solve s

solve s = 7 - fromJust (elemIndex s days)
  where
    days = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
