"use strict";

main(require("fs").readFileSync("/dev/stdin", "utf-8"));

function main(input) {
  const date = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
  input = input.trim().split("\n")[0];
  let result = 0;
  switch (input) {
    case "SUN":
      result = 7;
      break;
    case "MON":
      result = 6;
      break;
    case "TUE":
      result = 5;
      break;
    case "WED":
      result = 4;
      break;
    case "THU":
      result = 3;
      break;
    case "FRI":
      result = 2;
      break;
    case "SAT":
      result = 1;
      break;
  }
  console.log(result);
}
