#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>

using namespace std;

char T[7][7]{"MON","TUE","WED","THU","FRT","SAT","SUN"};

char G[7];

int main()
{
	while(cin>>G)
	{
		for(int i=0;i<7;i++)
		{
			if(strcmp(T[i],G)==0)
			{
				cout<<i+1;
				return 0;
			}
		}
	}
}
