import           Data.List

toWeekNumber s = case findIndex (== s) weekList of
  Just n  -> n
  Nothing -> error $ "toWeekNumber: invalid string: " ++ show s
  where weekList = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]

main = (7 -) . toWeekNumber <$> getLine >>= print
