const Main = (input) => {
  const line = input.split('\n')
  const weathers = line[0].split('')
  let current = 0
  let result = 0

  weathers.forEach(weather => {
    current = (weather === 'R') ? ++current : 0
    result = Math.max(result, current)
  })

  console.log(result)
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))