#include <iostream>

using namespace std;

int main()
{
    string arr[7]={"SUN", "MON", "TUE", "WED","THU","FRI", "SAT"};
string s;cin>>s;
for(int i=0;i<7;i++)
{
  if(arr[i]==s)
  {
      cout<<(7-(i+1))+1;
      return 0;
  }
}
    return 0;
}
