module Main where

import Data.Foldable
import Data.List

main :: IO ()
main = do
    s <- getLine
    forM_ (elemIndex s wds) $ \s -> print $ 7 - s

wds :: [String]
wds = [ "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" ]
