let S = Array(readLine()!)
if S[0] == "R" {
    if S[1] == "R" {
        print(S[2] == "R" ? 3 : 2)
    } else {
        print(1)
    }
} else {
    if S[1] == "R" {
        print(S[2] == "R" ? 2 : 1)
    } else {
        print(S[2] == "R" ? 1 : 0)
    }
}
