import qualified Data.ByteString.Char8 as BS
import Data.List
import Data.Maybe

readString = map BS.unpack . BS.words

getString = readString <$> BS.getLine

main = do
  [s] <- getString
  let xs = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
  print $ 7 - fromJust (findIndex (== s) xs)
