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