import Foundation

let input = readLine()!

if "SSS" == input {
    print("0")
} else if "SSR" == input || "SRS" == input || "RSS" == input || "RSR" == input {
    print("1")
} else if "SRR" == input || "RRS" == input  {
    print("2")
} else if "RRR" == input {
    print("3")
}
 