const input = require("fs").readFileSync("/dev/stdin", "utf8")
const lines = input.split('\n')
const s = lines[0].trim()

let ans = 1
if (s === 'SSS') {
    ans = 0
} else if (s === 'RRR') {
    ans = 3
} else if (s === 'RRS') {
    ans = 2
} else if (s === 'SRR') {
    ans = 2
}
console.log(ans)