import Control.Applicative

main :: IO ()
main = solve <$> getLine >>= print

solve :: String -> Int
solve w
  | w == "SUN" = 7
  | w == "MON" = 6
  | w == "TUE" = 5
  | w == "WED" = 4
  | w == "THU" = 3
  | w == "FRI" = 2
  | otherwise = 1
