import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String input = sc.next();
    sc.close();
    if("SSS".equals(input)){
      System.out.println(0);
    } else if("RRS".equals(input) || "SRR".equals(input)){
      System.out.println(2);
    } else if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    }
  }
} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String input = sc.next();
    sc.close();
    if("SSS".equals(input)){
      System.out.println(0);
    } else if("RRS".equals(input) || "SRR".equals(input)){
      System.out.println(2);
    } else if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String input = sc.next();
    sc.close();
    if("SSS".equals(input)){
      System.out.println(0);
    } else if("RRS".equals(input) || "SRR".equals(input)){
      System.out.println(2);
    } else if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    String input = sc.next();
    sc.close();
    if("SSS".equals(input)){
      System.out.println(0);
    } else if("RRS".equals(input) || "SRR".equals(input)){
      System.out.println(2);
    } else if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.next(); input sc.next() sc.next sc sc.close() sc.close sc if("SSS".equals(input)){
      System.out.println(0);
    } else if("RRS".equals(input) || "SRR".equals(input)){
      System.out.println(2);
    } else if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    } "SSS".equals(input) "SSS".equals "SSS" input {
      System.out.println(0);
    } System.out.println(0) System.out.println System.out System System.out 0 if("RRS".equals(input) || "SRR".equals(input)){
      System.out.println(2);
    } else if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    } "RRS".equals(input) || "SRR".equals(input) "RRS".equals(input) "RRS".equals "RRS" input "SRR".equals(input) "SRR".equals "SRR" input {
      System.out.println(2);
    } System.out.println(2) System.out.println System.out System System.out 2 if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    } "RRR".equals(input) "RRR".equals "RRR" input {
      System.out.println(3);
    } System.out.println(3) System.out.println System.out System System.out 3 {
      System.out.println(1);
    } System.out.println(1) System.out.println System.out System System.out 1 String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String input = sc.next();
    sc.close();
    if("SSS".equals(input)){
      System.out.println(0);
    } else if("RRS".equals(input) || "SRR".equals(input)){
      System.out.println(2);
    } else if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    }
  }
} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String input = sc.next();
    sc.close();
    if("SSS".equals(input)){
      System.out.println(0);
    } else if("RRS".equals(input) || "SRR".equals(input)){
      System.out.println(2);
    } else if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    }
  }
} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String input = sc.next();
    sc.close();
    if("SSS".equals(input)){
      System.out.println(0);
    } else if("RRS".equals(input) || "SRR".equals(input)){
      System.out.println(2);
    } else if("RRR".equals(input)){
      System.out.println(3);
    } else {
      System.out.println(1);
    }
  }
}