#include<cstdio>
#include<cstring>
int main(void){
	char a[][5]={"","SAT","FRI","THU","WED","TUE","MON","SUN"};
	char s[5];
	scanf("%s",s);
	for(int i=1;i<=7;i++){
		if(strcmp(s,a[i])==0) printf("%d",i);
	}
	return 0;
}