process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    const n = lines[0].split("S");
    let max = Math.max(...n.map(v=>v.length));
    console.log(max)
    
    
});

check = (a)=>{
    return a.toString()===a.toString().split("").reverse().join("")?1:0;
}
