#!/bin/bash

read tenki
len=${#tenki}
i=0
cnt=0
res=0

while [ $i -lt $len ]
do
	if [ "${tenki:$i:1}" == "R" ]
	then
		(( cnt += 1 ))
		(( res =  res > cnt ? res : cnt ))
	elif [ "${tenki:$i:1}" == "S" ]
	then 
		cnt=0
	fi

	(( ++i ))
done	
echo "$res"
