#include <bits/stdc++.h>
using namespace std;
string b[8]={"SUN", "MON","TUE","WED","THU","FRI","SAT"};
int main()
{
	string a;
	cin>>a;
	for(int i=0;i<7;i++)
	{
		if(b[i]==a)cout<<7-i<<'\n';
	}
	return 0;
}
