import Foundation

func main() {
    let s = readLine()!
    var count = s.numberOfOccurrences(of: "R")
    if count == 3 || count == 1 || count == 0 {
        print(count)
    } else {
        count = s.numberOfOccurrences(of: "RR")
        if count == 1 {
            print(2)
        } else {
            print(1)
        }
    }
    
}

main()

extension String {
    func numberOfOccurrences(of word: String) -> Int {
        var count = 0
        var nextRange = self.startIndex..<self.endIndex
        while let range = self.range(of: word, options: .caseInsensitive, range: nextRange) {
            count += 1
            nextRange = range.upperBound..<self.endIndex
        }
        return count
    }
}
