#!/usr/bin/env ruby
inputs = gets.chomp.split('')
result = 0
in_r = false

inputs.each do |i|
  if i == 'R'
    result += 1 if result == 0 || in_r
    in_r = true
  else
    in_r = false
  end
end

puts result
