function main(input) {
  input = input.split('');
  let max = 0;
  let currentMax = 0;
  let current = 'R';
  for (let i = 0;i < input.length;i++) {
    if (input[i] == 'R' && current == 'R') {
      max++;
    } else if (input[i] == 'R') {
      max = 1;
    }
    if (input[i] == 'S') {
      currentMax = max;
      max = 0;
    }
    current = input[i];
  }
  console.log(Math.max(max, currentMax));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))