import java.util.Scanner;
class Main {
  static public void main(String[] args) {
    Scanner sc = new Scanner(System.in);
      String S = sc.next();
    switch (S) {
      case "SRR": System.out.println("2"); break;
      case "RRS": System.out.println("2"); break;
      case "RRR": System.out.println("3"); break;
      case "RSR": System.out.println("1"); break;
      case "SSS": System.out.println("0"); break;
      case "SSR": System.out.println("1"); break;
      case "SRS": System.out.println("1"); break;
      case "RSS": System.out.println("1"); break;
    }
  }
} import java.util.Scanner; Scanner java.util class Main {
  static public void main(String[] args) {
    Scanner sc = new Scanner(System.in);
      String S = sc.next();
    switch (S) {
      case "SRR": System.out.println("2"); break;
      case "RRS": System.out.println("2"); break;
      case "RRR": System.out.println("3"); break;
      case "RSR": System.out.println("1"); break;
      case "SSS": System.out.println("0"); break;
      case "SSR": System.out.println("1"); break;
      case "SRS": System.out.println("1"); break;
      case "RSS": System.out.println("1"); break;
    }
  }
} Main static public void main(String[] args) {
    Scanner sc = new Scanner(System.in);
      String S = sc.next();
    switch (S) {
      case "SRR": System.out.println("2"); break;
      case "RRS": System.out.println("2"); break;
      case "RRR": System.out.println("3"); break;
      case "RSR": System.out.println("1"); break;
      case "SSS": System.out.println("0"); break;
      case "SSR": System.out.println("1"); break;
      case "SRS": System.out.println("1"); break;
      case "RSS": System.out.println("1"); break;
    }
  } main {
    Scanner sc = new Scanner(System.in);
      String S = sc.next();
    switch (S) {
      case "SRR": System.out.println("2"); break;
      case "RRS": System.out.println("2"); break;
      case "RRR": System.out.println("3"); break;
      case "RSR": System.out.println("1"); break;
      case "SSS": System.out.println("0"); break;
      case "SSR": System.out.println("1"); break;
      case "SRS": System.out.println("1"); break;
      case "RSS": System.out.println("1"); break;
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc switch (S) {
      case "SRR": System.out.println("2"); break;
      case "RRS": System.out.println("2"); break;
      case "RRR": System.out.println("3"); break;
      case "RSR": System.out.println("1"); break;
      case "SSS": System.out.println("0"); break;
      case "SSR": System.out.println("1"); break;
      case "SRS": System.out.println("1"); break;
      case "RSS": System.out.println("1"); break;
    } S case "SRR": "SRR" case "SRR": System.out.println("2") System.out.println System.out System System.out "2" break; 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" break; case "RSR": "RSR" case "RSR": System.out.println("1") System.out.println System.out System System.out "1" break; case "SSS": "SSS" case "SSS": System.out.println("0") System.out.println System.out System System.out "0" break; case "SSR": "SSR" case "SSR": System.out.println("1") System.out.println System.out System System.out "1" break; case "SRS": "SRS" case "SRS": System.out.println("1") System.out.println System.out System System.out "1" break; case "RSS": "RSS" case "RSS": System.out.println("1") System.out.println System.out System System.out "1" break; String[] args args
import java.util.Scanner;
class Main {
  static public void main(String[] args) {
    Scanner sc = new Scanner(System.in);
      String S = sc.next();
    switch (S) {
      case "SRR": System.out.println("2"); break;
      case "RRS": System.out.println("2"); break;
      case "RRR": System.out.println("3"); break;
      case "RSR": System.out.println("1"); break;
      case "SSS": System.out.println("0"); break;
      case "SSR": System.out.println("1"); break;
      case "SRS": System.out.println("1"); break;
      case "RSS": System.out.println("1"); break;
    }
  }
}