func mainA() {
    let S = readLine()!

    switch S {
    case "SSS":
        print(0)
    case "SSR":
        print(1)
    case "SRS":
        print(1)
    case "RSS":
        print(1)
    case "SRR":
        print(2)
    case "RRS":
        print(2)
    case "RSR":
        print(1)
    case "RRR":
        print(3)
    default:
        fatalError()
    }
}
mainA()