(* 基本 *)
(* ocamlc str.cma main.ml でコンパイルできる *)
let () =
  let l = [("SUN",7);("MON",6);("TUE",5);("WED",4);("THU",3);("FRI",2);("SAT",1)] in
  let s = Scanf.sscanf (input_line stdin) "%s" (fun a -> a) in
  let ans = List.assoc s l in
  print_int ans;
  print_newline ()
