s = gets.split("")
temp = ""
ans = 0

(0..2).each do |i|
  if i == 0 && s[i] == "R"
    ans += 1
  end
  
  if s[i] == "R" && s[i] == temp
    ans += 1
  else
    ans += 0
  end
  
  temp = s[i]

end

puts ans