import std.stdio;
import std.string;

void main() {
  string s = readln.chomp;
  if (s == "SUN") writeln(7);
  if (s == "MON") writeln(6);
  if (s == "TUE") writeln(5);
  if (s == "WED") writeln(4);
  if (s == "THU") writeln(3);
  if (s == "FRI") writeln(2);
  if (s == "SAT") writeln(1);
}
