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

string D[7]={"SAT","FRI","THU","WED","TUE","MON","SUN"};

int main(){
	string S;
	cin >> S;
	for(int i=0;i<7;i++)if(S==D[i])cout << i+1 << endl;
	return 0;
}