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

int main()
{
    char ch[3];
    cin>>ch;

    if(ch[0]=='S')
        {
            if(ch[1]=='U')cout<<"7"<<endl;
            else cout<<"1"<<endl;
        }
    else if(ch[0]=='T')
        {
            if(ch[1]=='U')cout<<"5"<<endl;
            else cout<<"3"<<endl;
        }
    else if(ch[0]=='M')cout<<"6"<<endl;
    else if(ch[0]=='W')cout<<"4"<<endl;
    else cout<<"2"<<endl;

    return 0;
}

#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7;




int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    string s[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    string x;
    cin >> x;
    int ans = 0;
    for(int i = 0; i < 7; i++) if(s[i] == x) ans = i;
    cout << 7 - ans;

    return 0;
}
