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

int main(){
	string s;	cin>>s;
	string weeks[7]={"SUN","MON","TUE","WED","THU","FRI","SAT"};

	for(int i=0;i<7;i++){
		if(weeks[i]==s){
			cout<<7-i<<endl;
			return 0;
		}
	}
	

	return 0;
}
