#include <iostream>
#include <string>
using namespace std;
int main(){
  string s, w[]={"SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN"};
  cin >> s;
  for(int i=0; i<7; i++){
    if(s==w[i]) {cout << i+1; return 0;}
  }
  return 0;
}