#include<iostream>
#include<algorithm>
using namespace std;
int main (void)
{

  string s;
  cin>>s;
  if(s=="SUN")cout<<"7"<<endl;
  if(s=="MON")cout<<"6"<<endl;
  if(s=="TUE")cout<<"5"<<endl;
  if(s=="WED")cout<<"4"<<endl;
  if(s=="THU")cout<<"3"<<endl;
  if(s=="FRI")cout<<"2"<<endl;
  if(s=="SAT")cout<<"1"<<endl;
}
  
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define In_The_Name_Of_Allah_The_Merciful ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define Alhamdulillah return 0;
#define debug(n) cerr << "[" << #n << " = " << n << "]" << endl 

void Suhaib_Sawalha (){

    vector <string> v = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    string s;
    cin >> s;
    cout << v.end() - find(v.begin(),v.end(),s);

}

int main(){
                                In_The_Name_Of_Allah_The_Merciful   /* بسم الله الرحمن الرحيم  */
#ifndef ONLINE_JUDGE
    freopen("SuhaibSawalha1.txt","r",stdin);
#endif
//int _;for(cin>>_;_;--_,cout<<'\n')
        Suhaib_Sawalha();
                                         Alhamdulillah                    /* الحمد لله */
}