s = gets.chomp.split('')

flag = false
r = 0
3.times do |i|
  flag = s[i] == 'R'

  if flag
    if s[i] == 'R'
      r += 1
      next
    else
      break
    end
  else
    if s[i] == 'R'
      flag = true
      r += 1
    end
  end
end

puts r
