#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
typedef long long LL;
using namespace std;

char u;
void scan(int &x){
	int f=1;
    while(u = getchar(), u < '0' || u > '9'){if(u=='-') f=-1;};
    x = u-'0';
    while(u = getchar(), u >= '0' && u <= '9') x = x * 10 + u -'0';
    x*=f;
}

int main(){
	string s;
	cin >>s;
	string sev="SUN";
	string one="MON"; 
	string tow="TUE";
	string tre="WED";
	string four="THU";
	string five="FRI"; 
	string six="SAT";
	if(s==sev) { printf("7\n");return 0;}
	if(s==one) { printf("6\n");return 0;}
	if(s==tow) { printf("5\n");return 0;}
	if(s==tre) { printf("4\n");return 0;}
	if(s==four) { printf("3\n");return 0;}
	if(s==five) { printf("2\n");return 0;}
	if(s==six) { printf("1\n");return 0;}
	return 0;
}
