const log = (...val) => console.log(...val);
function Main(input){

    if(input === 'SSS') log(0);
    if(input === 'SSR') log(1);
    if(input === 'SRS') log(1);
    if(input === 'SRR') log(2);
    if(input === 'RSS') log(1);
    if(input === 'RSR') log(1);
    if(input === 'RRS') log(2);
    if(input === 'RRR') log(3);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());