public class Main {
  public static void main(String[] args) {
    String S = new java.util.Scanner(System.in).nextLine();
    switch (S) {
      case "SSS":
        System.out.println("0");
        break;
      case "SSR":
      case "SRS":
      case "RSS":
      case "RSR":
        System.out.println("1");
        break;
      case "SRR":
      case "RRS":
        System.out.println("2");
        break;
      case "RRR":
        System.out.println("3");
    }
  }
} public class Main {
  public static void main(String[] args) {
    String S = new java.util.Scanner(System.in).nextLine();
    switch (S) {
      case "SSS":
        System.out.println("0");
        break;
      case "SSR":
      case "SRS":
      case "RSS":
      case "RSR":
        System.out.println("1");
        break;
      case "SRR":
      case "RRS":
        System.out.println("2");
        break;
      case "RRR":
        System.out.println("3");
    }
  }
} Main public static void main(String[] args) {
    String S = new java.util.Scanner(System.in).nextLine();
    switch (S) {
      case "SSS":
        System.out.println("0");
        break;
      case "SSR":
      case "SRS":
      case "RSS":
      case "RSR":
        System.out.println("1");
        break;
      case "SRR":
      case "RRS":
        System.out.println("2");
        break;
      case "RRR":
        System.out.println("3");
    }
  } main {
    String S = new java.util.Scanner(System.in).nextLine();
    switch (S) {
      case "SSS":
        System.out.println("0");
        break;
      case "SSR":
      case "SRS":
      case "RSS":
      case "RSR":
        System.out.println("1");
        break;
      case "SRR":
      case "RRS":
        System.out.println("2");
        break;
      case "RRR":
        System.out.println("3");
    }
  } String S = new java.util.Scanner(System.in).nextLine(); S new java.util.Scanner(System.in).nextLine() new java.util.Scanner(System.in).nextLine new java.util.Scanner(System.in) switch (S) {
      case "SSS":
        System.out.println("0");
        break;
      case "SSR":
      case "SRS":
      case "RSS":
      case "RSR":
        System.out.println("1");
        break;
      case "SRR":
      case "RRS":
        System.out.println("2");
        break;
      case "RRR":
        System.out.println("3");
    } S case "SSS": "SSS" case "SSS": System.out.println("0") System.out.println System.out System System.out "0" break; case "SSR": "SSR" case "SSR": case "SRS": "SRS" case "SRS": case "RSS": "RSS" case "RSS": case "RSR": "RSR" case "RSR": System.out.println("1") System.out.println System.out System System.out "1" break; case "SRR": "SRR" case "SRR": case "RRS": "RRS" case "RRS": System.out.println("2") System.out.println System.out System System.out "2" break; case "RRR": "RRR" case "RRR": System.out.println("3") System.out.println System.out System System.out "3" String[] args args public class Main {
  public static void main(String[] args) {
    String S = new java.util.Scanner(System.in).nextLine();
    switch (S) {
      case "SSS":
        System.out.println("0");
        break;
      case "SSR":
      case "SRS":
      case "RSS":
      case "RSR":
        System.out.println("1");
        break;
      case "SRR":
      case "RRS":
        System.out.println("2");
        break;
      case "RRR":
        System.out.println("3");
    }
  }
} public class Main {
  public static void main(String[] args) {
    String S = new java.util.Scanner(System.in).nextLine();
    switch (S) {
      case "SSS":
        System.out.println("0");
        break;
      case "SSR":
      case "SRS":
      case "RSS":
      case "RSR":
        System.out.println("1");
        break;
      case "SRR":
      case "RRS":
        System.out.println("2");
        break;
      case "RRR":
        System.out.println("3");
    }
  }
} Main
public class Main {
  public static void main(String[] args) {
    String S = new java.util.Scanner(System.in).nextLine();
    switch (S) {
      case "SSS":
        System.out.println("0");
        break;
      case "SSR":
      case "SRS":
      case "RSS":
      case "RSR":
        System.out.println("1");
        break;
      case "SRR":
      case "RRS":
        System.out.println("2");
        break;
      case "RRR":
        System.out.println("3");
    }
  }
}
