import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int ans = 1;
    switch (s) {
      case "RRR":
        ans = 3;
        break;
      case "RRS":
      case "SRR":
        ans = 2;
        break;
      case "SSS":
        ans = 0;
        break;
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int ans = 1;
    switch (s) {
      case "RRR":
        ans = 3;
        break;
      case "RRS":
      case "SRR":
        ans = 2;
        break;
      case "SSS":
        ans = 0;
        break;
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int ans = 1;
    switch (s) {
      case "RRR":
        ans = 3;
        break;
      case "RRS":
      case "SRR":
        ans = 2;
        break;
      case "SSS":
        ans = 0;
        break;
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int ans = 1;
    switch (s) {
      case "RRR":
        ans = 3;
        break;
      case "RRS":
      case "SRR":
        ans = 2;
        break;
      case "SSS":
        ans = 0;
        break;
    }
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int ans = 1; ans 1 switch (s) {
      case "RRR":
        ans = 3;
        break;
      case "RRS":
      case "SRR":
        ans = 2;
        break;
      case "SSS":
        ans = 0;
        break;
    } s case "RRR": "RRR" case "RRR": ans = 3 ans 3 break; case "RRS": "RRS" case "RRS": case "SRR": "SRR" case "SRR": ans = 2 ans 2 break; case "SSS": "SSS" case "SSS": ans = 0 ans 0 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int ans = 1;
    switch (s) {
      case "RRR":
        ans = 3;
        break;
      case "RRS":
      case "SRR":
        ans = 2;
        break;
      case "SSS":
        ans = 0;
        break;
    }
    System.out.println(ans);
  }
}