#include <bits/stdc++.h>
using namespace std;
 
int main()
{
  vector<string> M = {"", "SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"};
  string S;
  cin >> S;
  for (int i = 0; i < 8; i++)
  {
    if (S == M[i])
      cout << i << endl;
  }
}