#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;

  string weeks[] = {"SUN","MON","TUE","WED","THU","FRI","SAT"};

  for(int i = 0; i < 7; i++){
    if(weeks[i] == S){
      cout << 7 - i << endl;
    }
  }
}