#include <bits/stdc++.h>
using namespace std;
int main()
{
	map<string , int> rep;
	rep["SUN"] = 7;
	rep["MON"] = 6;
	rep["TUE"] = 5;
	rep["WED"] = 4;
	rep["THU"] = 3;
	rep["FRI"] = 2;
	rep["SAT"] = 1;
	string s;
	cin >> s;
	cout<<rep[s]<<endl;

}