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

int main(){
  string S;
  cin>>S;
  string A[100]={"SAT","FRI","THU","WED","TUE","MON","SUN"};
  for(int i=0;i<7;i++){
    if(S==A[i]){
      cout<<i+1;
      break;
    }
  }
}