fun main(args: Array<String>) {
  val tempature = readLine()!!

  fun countRDay(tempatureDays: String, maxCountDay: Int = 0, counter: Int = 0): Int {
    val newCounter = if(tempatureDays.first() == 'R') counter + 1 else 0
    val maxCount = if(maxCountDay < newCounter) newCounter else maxCountDay
    
    return if(tempatureDays.length == 1) maxCount else countRDay(tempatureDays.substring(1), maxCount, newCounter)
  }
  
  println(countRDay(tempature))
}