func :: String -> [String] -> Int
func s days | s == head days = length days
            | otherwise = 0 + func s (tail days)
main :: IO()
main = do
  s <- getLine
  putStrLn $ show (func s ["SUN","MON","TUE","WED","THU","FRI","SAT"])