main = do
  s <- getLine
  print $ solve s
  
solve s
  | s == "SUN" = 7
  | s == "MON" = 6
  | s == "TUE" = 5
  | s == "WED" = 4
  | s == "THU" = 3
  | s == "FRI" = 2
  | s == "SAT" = 1
  | otherwise = -1