 import std.stdio, std.conv, std.string, std.range, std.algorithm, std.array,
  std.functional, std.container, std.typecons;

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