let scan_string () = Scanf.scanf " %s" (fun x -> x)
let print_int n = Printf.printf "%d\n" n

let calc s =
  if s = "SUN" then 7
  else if s = "MON" then 6
  else if s = "TUE" then 5
  else if s = "WED" then 4
  else if s = "THU" then 3
  else if s = "FRI" then 2
  else 1

let () =
  let s = scan_string() in
  print_int (calc s)