import java.util.*;

class Main{
    static Scanner sc = new Scanner(System.in);

    public static void main(String args[]){
        String S=sc.next();
        if(S.equals("RRR")) System.out.println(3);
        else if(S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("SRS")) System.out.println(1);
      	else if(S.equals("SSS")) System.out.println(0);
        else System.out.println(2);
    }
} import java.util.*; util.* java class Main{
    static Scanner sc = new Scanner(System.in);

    public static void main(String args[]){
        String S=sc.next();
        if(S.equals("RRR")) System.out.println(3);
        else if(S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("SRS")) System.out.println(1);
      	else if(S.equals("SSS")) System.out.println(0);
        else System.out.println(2);
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String args[]){
        String S=sc.next();
        if(S.equals("RRR")) System.out.println(3);
        else if(S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("SRS")) System.out.println(1);
      	else if(S.equals("SSS")) System.out.println(0);
        else System.out.println(2);
    } main {
        String S=sc.next();
        if(S.equals("RRR")) System.out.println(3);
        else if(S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("SRS")) System.out.println(1);
      	else if(S.equals("SSS")) System.out.println(0);
        else System.out.println(2);
    } String S=sc.next(); S sc.next() sc.next sc if(S.equals("RRR")) System.out.println(3);
        else if(S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("SRS")) System.out.println(1);
      	else if(S.equals("SSS")) System.out.println(0);
        else System.out.println(2); S.equals("RRR") S.equals S "RRR" System.out.println(3) System.out.println System.out System System.out 3 if(S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("SRS")) System.out.println(1);
      	else if(S.equals("SSS")) System.out.println(0);
        else System.out.println(2); S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("SRS") S.equals("SSR") S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("SRS") S.equals("RSR") S.equals S "RSR" S.equals("RSS") S.equals S "RSS" S.equals("SSR") S.equals S "SSR" S.equals("SRS") S.equals S "SRS" System.out.println(1) System.out.println System.out System System.out 1 if(S.equals("SSS")) System.out.println(0);
        else System.out.println(2); S.equals("SSS") S.equals S "SSS" System.out.println(0) System.out.println System.out System System.out 0 System.out.println(2) System.out.println System.out System System.out 2 String args[] args
import java.util.*;

class Main{
    static Scanner sc = new Scanner(System.in);

    public static void main(String args[]){
        String S=sc.next();
        if(S.equals("RRR")) System.out.println(3);
        else if(S.equals("RSR")||S.equals("RSS")||S.equals("SSR")||S.equals("SRS")) System.out.println(1);
      	else if(S.equals("SSS")) System.out.println(0);
        else System.out.println(2);
    }
}
