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

int main(){
  vector<string>str={"SUN","MON","TUE","WED","THU","FRI","SAT"};
  int i,ans;
  i=0;
  ans=0;
  string s;
  cin>>s;
  while(str[i]!=s){
    ans++;
    i++;
  }
  
  cout<<7-ans;  
 
}