unittest
{
	assert( [ "RRS" ].solve == 2 );
	assert( [ "SSS" ].solve == 0 );
	assert( [ "RSR" ].solve == 1 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;

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

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto s = input.front.to!( dchar[] );
	
	auto ans = 0L;
	foreach( c; s.group )
	{
		if( c[ 0 ] == 'R' ) ans = max( ans, c[ 1 ] );
	}
	return ans;
}
