import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;

auto a = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];

void main() {
  auto s = readln.strip;
  foreach (i; 0 .. a.length) {
    if (a[i] == s) {
      writeln (7 - i);
      break;
    }
  }
}

