#include <bits/stdc++.h>
using namespace std;

int main(){
  string s;
  cin >> s;
  map<string, int> d;
  d["SUN"] = 1;
  d["MON"] = 2;
  d["TUE"] = 3;
  d["WED"] = 4;
  d["THU"] = 5;
  d["FRI"] = 6;
  d["SAT"] = 7;

  cout << 8-d.at(s) << endl;
}