struct Scanner {
    private var elements = [String]()
    private var index = 0

    mutating func peek() -> String {
        while elements.count == index {
            elements = readLine()!.split(separator: " ").map(String.init)
            index = 0
        }
        return elements[index]
    }

    mutating func next() -> String {
        let value = peek()
        index += 1
        return value
    }

    mutating func nextInt() -> Int {
        return Int(next())!
    }

    mutating func nextDouble() -> Double {
        return Double(next())!
    }
}

var scanner = Scanner()
let S = [Character](scanner.next())

if S[0] == "R" && S[1] == "R" && S[2] == "R" {
    print(3)
} else if S[0] == "R" && S[1] == "R" || S[1] == "R" && S[2] == "R" {
    print(2)
} else if S[0] == "R" || S[1] == "R" || S[2] == "R" {
    print(1)
} else {
    print(0)
}
