#include <iostream>
#include <map>
using namespace std;

int main()
{
    map<string, int> s;
    s["SUN"] = 2;
    s["MON"] = 3;
    s["TUE"] = 4;
    s["WED"] = 5;
    s["THU"] = 6;
    s["FRI"] = 7;
    s["SAT"] = 1;
    string day; cin >> day;
    if(day == "SUN")
    {

        cout << 7;
        return 0;
    }
    int con = 0, c = s[day];
    while(s["SUN"] != c)
    {
        c++;
        con++;
        if(c == 8) c = 1;

    }
    cout << con;
    return 0;
}
