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', () => {
  let weatherInThreeDays = lines[0];
  var mostContinuousRainyDays = 0;
  var currentContinuousRainyDays = 0;
  
  for (var i = 0; i < weatherInThreeDays.length; i++) {
    var weatherToday = weatherInThreeDays.substr(i, 1);
    if (weatherToday === 'S') {
      if (mostContinuousRainyDays < currentContinuousRainyDays) {
          mostContinuousRainyDays = currentContinuousRainyDays;
      }
      currentContinuousRainyDays = 0;
    } else {
      currentContinuousRainyDays++;
      if (mostContinuousRainyDays < currentContinuousRainyDays) {
          mostContinuousRainyDays = currentContinuousRainyDays;
      }
    }
  }
  console.log(mostContinuousRainyDays);
});