#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
#define vec(s) vector<s>
#define vvec(s) vector<vector<s>>
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
#define out(s) cout<<s<<endl;
#define pb(s) push_back(s);
#define sp " " 
#define INF 10000000000
#define LINF 9000000000000000000
#define all(s) s.begin(),s.end()
void vout(vi v){
    for(lli i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    map<string, lli > ans;
    ans["SUN"]=7;
    ans["MON"]=6;
    ans["TUE"]=5;
    ans["WED"]=4;
    ans["THU"]=3;
    ans["FRI"]=2;
    ans["SAT"]=1;
    string s;
    cin>>s;
    out(ans[s]);
}
#include <bits/stdc++.h>
using namespace std;


void solve(std::string S){
    vector<string> yobi = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    for(int i = 0; i < yobi.size(); ++i){
        if(yobi[i] == S){
            cout << 7 - i << endl;
            break;
        }
    }
}

int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}
