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

vector<string> ans = {"","SAT","FRI","THU","WED","TUE","MON","SUN"};

int main(){
	string s;
	cin>>s;
	for(int i=1;i<=7;i++)
		if(ans[i]==s)
			cout<<i<<endl;
}
