void main(){
	string s = _scan!string();
	switch(s){
		case "SUN": writeln(7); break;
		case "MON": writeln(6); break;
		case "TUE": writeln(5); break;
		case "WED": writeln(4); break;
		case "THU": writeln(3); break;
		case "FRI": writeln(2); break;
		case "SAT": writeln(1); break;
		default: break;
	}
}

import std.stdio, std.conv, std.algorithm, std.numeric, std.string, std.math;

// 1要素のみの入力
T _scan(T= int)(){
	return to!(T)( readln().chomp() );
}

// 1行に同一型の複数入力
T[] _scanln(T = int)(){
	T[] ln;
	foreach(string elm; readln().chomp().split()){
		ln ~= elm.to!T();
	}
	return ln;
}
