(def weeks ["MON" "TUE" "WED" "THU" "FRI" "SAT" "SUN"])
(def week (read-line))
(def i (.indexOf weeks week))
(cond
  (= i 0) (print 6)
  (= i 1) (print 5)
  (= i 2) (print 4)
  (= i 3) (print 3)
  (= i 4) (print 2)
  (= i 5) (print 1)
  (= i 6) (print 7))