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

int main() {
	string S[7] = { "SUN", "MON","TUE","WED","THU","FRI","SAT"};
	string T;
	cin >> T;
	for (int i = 0; i < 7; i++) {
		if (S[i] == T) {
			cout << 7 - i << endl;
			return 0;
		}
	}
}