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', () => {
  var N = lines[0].split("");
  if(N[0]==="R"){
    if(N[1]==="R"){
      if(N[2]==="R"){
        console.log(3);
      }else{
        console.log(2);
      }
    }else{
      console.log(1);
    }
  }else{
    if(N[1]==="R"){
      if(N[2]==="R"){
        console.log(2);
      }else{
        console.log(1);
      }
    }else{
      if(N[2]==="R"){
        console.log(1);
      }else{
        console.log(0);
      }
    }      
});