import java.util.*

fun main(args : Array<String>) {
    val scanner = Scanner(System.`in`)
    val S = scanner.nextLine()
    var i = 0
    var j = 0
    var max = 0
    while(j < S.length) {
      if(S[j] == 'S') {
        i = j + 1
      }
      max = Math.max(max, j - i + 1)
      j++
    }
    println(max)
}