import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func readString() -> String {
    return readLine()!
}

func readLines(times: Int) -> [String] {
    var array = [String]()
    for _ in 0..<times {
        array.append(readLine()!)
    }
    return array
}

func readSeparatedStrings() -> [String] {
    return readLine()!.split(separator: " ").map {String($0)}
}

func readStringToStrings() -> [String] {
    return readLine()!.map{String($0)}
}

func readSeparatedInts() -> [Int] {
    return readLine()!.split(separator: " ").map {Int($0)!}
}
func readSeparatedDouble() -> [Double] {
    return readLine()!.split(separator: " ").map {Double($0)!}
}

// 二進数に変換
func convertIntToRadix2(n: Int, radix: Int = 2) -> String {
    return String(n, radix: radix)
}

//配列を逆順にする reverced ソートする　sorted

let days = [Character](readString())

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

