import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String r = "R";
    int count = s.indexOf(r);
    int lastcount = s.lastIndexOf(r);
    if(s.contentEquals("RRR")){
      System.out.println("3");
    }else if(s.contentEquals("SSR")){
      System.out.println("1");
    }else if(s.contentEquals("SRS")){
      System.out.println("1"); 
    }else if(s.contentEquals("RSS")){
      System.out.println("1");
    }else if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    }
  }
}
 import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String r = "R";
    int count = s.indexOf(r);
    int lastcount = s.lastIndexOf(r);
    if(s.contentEquals("RRR")){
      System.out.println("3");
    }else if(s.contentEquals("SSR")){
      System.out.println("1");
    }else if(s.contentEquals("SRS")){
      System.out.println("1"); 
    }else if(s.contentEquals("RSS")){
      System.out.println("1");
    }else if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String r = "R";
    int count = s.indexOf(r);
    int lastcount = s.lastIndexOf(r);
    if(s.contentEquals("RRR")){
      System.out.println("3");
    }else if(s.contentEquals("SSR")){
      System.out.println("1");
    }else if(s.contentEquals("SRS")){
      System.out.println("1"); 
    }else if(s.contentEquals("RSS")){
      System.out.println("1");
    }else if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    }
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String r = "R";
    int count = s.indexOf(r);
    int lastcount = s.lastIndexOf(r);
    if(s.contentEquals("RRR")){
      System.out.println("3");
    }else if(s.contentEquals("SSR")){
      System.out.println("1");
    }else if(s.contentEquals("SRS")){
      System.out.println("1"); 
    }else if(s.contentEquals("RSS")){
      System.out.println("1");
    }else if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc String r = "R"; r "R" int count = s.indexOf(r); count s.indexOf(r) s.indexOf s r int lastcount = s.lastIndexOf(r); lastcount s.lastIndexOf(r) s.lastIndexOf s r if(s.contentEquals("RRR")){
      System.out.println("3");
    }else if(s.contentEquals("SSR")){
      System.out.println("1");
    }else if(s.contentEquals("SRS")){
      System.out.println("1"); 
    }else if(s.contentEquals("RSS")){
      System.out.println("1");
    }else if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    } s.contentEquals("RRR") s.contentEquals s "RRR" {
      System.out.println("3");
    } System.out.println("3") System.out.println System.out System System.out "3" if(s.contentEquals("SSR")){
      System.out.println("1");
    }else if(s.contentEquals("SRS")){
      System.out.println("1"); 
    }else if(s.contentEquals("RSS")){
      System.out.println("1");
    }else if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    } s.contentEquals("SSR") s.contentEquals s "SSR" {
      System.out.println("1");
    } System.out.println("1") System.out.println System.out System System.out "1" if(s.contentEquals("SRS")){
      System.out.println("1"); 
    }else if(s.contentEquals("RSS")){
      System.out.println("1");
    }else if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    } s.contentEquals("SRS") s.contentEquals s "SRS" {
      System.out.println("1"); 
    } System.out.println("1") System.out.println System.out System System.out "1" if(s.contentEquals("RSS")){
      System.out.println("1");
    }else if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    } s.contentEquals("RSS") s.contentEquals s "RSS" {
      System.out.println("1");
    } System.out.println("1") System.out.println System.out System System.out "1" if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    } count == 0 && lastcount == 1 || count == 1 && lastcount == 2 count == 0 && lastcount == 1 count == 0 count 0 lastcount == 1 lastcount 1 count == 1 && lastcount == 2 count == 1 count 1 lastcount == 2 lastcount 2 {
      System.out.println("2");
    } System.out.println("2") System.out.println System.out System System.out "2" if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    } count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 count == 0 && lastcount == -1 count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 count == 0 && lastcount == 2 count == 0 count 0 lastcount == 2 lastcount 2 count == 2 && lastcount == -1 count == 2 count 2 lastcount == -1 lastcount -1 1 count == 0 && lastcount == -1 count == 0 count 0 lastcount == -1 lastcount -1 1 count == 1 && lastcount == -1 count == 1 count 1 lastcount == -1 lastcount -1 1 {
      System.out.println("1");
    } System.out.println("1") System.out.println System.out System System.out "1" if(s.contentEquals("SSS")){
      System.out.println("0");

    } s.contentEquals("SSS") s.contentEquals s "SSS" {
      System.out.println("0");

    } System.out.println("0") System.out.println System.out System System.out "0" String[] args args
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.nextLine();
    String r = "R";
    int count = s.indexOf(r);
    int lastcount = s.lastIndexOf(r);
    if(s.contentEquals("RRR")){
      System.out.println("3");
    }else if(s.contentEquals("SSR")){
      System.out.println("1");
    }else if(s.contentEquals("SRS")){
      System.out.println("1"); 
    }else if(s.contentEquals("RSS")){
      System.out.println("1");
    }else if(count == 0 && lastcount == 1 || count == 1 && lastcount == 2){
      System.out.println("2");
    }else if(count == 0 && lastcount == 2 || count == 2 && lastcount == -1|| count == 0 && lastcount == -1|| count == 1 && lastcount == -1 ){
      System.out.println("1");
    }else if(s.contentEquals("SSS")){
      System.out.println("0");

    }
  }
}

