unittest
{
	assert( [ "SAT" ].parse.expand.solve == 1 );
	assert( [ "SUN" ].parse.expand.solve == 7 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto s = input.front.to!( dchar[] );
	return tuple( s );
}

auto solve( dchar[] s )
{
	final switch( s )
	{
		case "SUN": return 7;
		case "MON": return 6;
		case "TUE": return 5;
		case "WED": return 4;
		case "THU": return 3;
		case "FRI": return 2;
		case "SAT": return 1;
	}
}
