function main(input) {
    input = input.trim().split(" ");
    var x = ["SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"];
    console.log(x.indexOf(input[0]) + 1);
  }
   
  main(require("fs").readFileSync("/dev/stdin", "utf8"));
