import java.util.*;

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        int x = 0;
        if(S.equals("RRR")) x = 3;
        else if(S.equals("RRS")) x = 2;
        else if(S.equals("SRR")) x = 2;
        else if(S.equals("RSR")) x = 1;
        else if(S.equals("RSS")) x = 1;
        else if(S.equals("SSR")) x = 1;
        else if(S.equals("SRS")) x = 1;
        
        System.out.println(x);
    }
}
