import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;
import std.ascii;


void main()
{
  auto s = readln.chomp;
  int res;
  switch (s) {
    case "SUN":
      res = 7;
      break;
    case "MON":
      res = 6;
      break;
    case "TUE":
      res = 5;
      break;
    case "WED":
      res = 4;
      break;
    case "THU":
      res = 3;
      break;
    case "FRI":
      res = 2;
      break;
    case "SAT":
      res = 1;
      break;
    default:
  }
  res.writeln;
}
