
import java.util.*;

public class Main {

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

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        if (s.equalsIgnoreCase("SRS")
                || s.equalsIgnoreCase("SSR")
                || s.equalsIgnoreCase("RSS")
                || s.equalsIgnoreCase("RSR")) {
            System.out.println(1);
        }
        else if(!s.contains("R")){
            System.out.println(0);
        }
        else if(s.equalsIgnoreCase("RRR")){
            System.out.println(3);
        }
        else System.out.println(2);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        if (s.equalsIgnoreCase("SRS")
                || s.equalsIgnoreCase("SSR")
                || s.equalsIgnoreCase("RSS")
                || s.equalsIgnoreCase("RSR")) {
            System.out.println(1);
        }
        else if(!s.contains("R")){
            System.out.println(0);
        }
        else if(s.equalsIgnoreCase("RRR")){
            System.out.println(3);
        }
        else System.out.println(2);
    } main {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        if (s.equalsIgnoreCase("SRS")
                || s.equalsIgnoreCase("SSR")
                || s.equalsIgnoreCase("RSS")
                || s.equalsIgnoreCase("RSR")) {
            System.out.println(1);
        }
        else if(!s.contains("R")){
            System.out.println(0);
        }
        else if(s.equalsIgnoreCase("RRR")){
            System.out.println(3);
        }
        else System.out.println(2);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) String s = in.next(); s in.next() in.next in if (s.equalsIgnoreCase("SRS")
                || s.equalsIgnoreCase("SSR")
                || s.equalsIgnoreCase("RSS")
                || s.equalsIgnoreCase("RSR")) {
            System.out.println(1);
        }
        else if(!s.contains("R")){
            System.out.println(0);
        }
        else if(s.equalsIgnoreCase("RRR")){
            System.out.println(3);
        }
        else System.out.println(2); s.equalsIgnoreCase("SRS")
                || s.equalsIgnoreCase("SSR")
                || s.equalsIgnoreCase("RSS")
                || s.equalsIgnoreCase("RSR") s.equalsIgnoreCase("RSS") s.equalsIgnoreCase("SRS")
                || s.equalsIgnoreCase("SSR")
                || s.equalsIgnoreCase("RSS")
                || s.equalsIgnoreCase("RSR") s.equalsIgnoreCase("SRS") s.equalsIgnoreCase s "SRS" s.equalsIgnoreCase("SSR") s.equalsIgnoreCase s "SSR" s.equalsIgnoreCase("RSS") s.equalsIgnoreCase s "RSS" s.equalsIgnoreCase("RSR") s.equalsIgnoreCase s "RSR" {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 if(!s.contains("R")){
            System.out.println(0);
        }
        else if(s.equalsIgnoreCase("RRR")){
            System.out.println(3);
        }
        else System.out.println(2); !s.contains("R") s.contains("R") s.contains s "R" {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 if(s.equalsIgnoreCase("RRR")){
            System.out.println(3);
        }
        else System.out.println(2); s.equalsIgnoreCase("RRR") s.equalsIgnoreCase s "RRR" {
            System.out.println(3);
        } System.out.println(3) System.out.println System.out System System.out 3 System.out.println(2) System.out.println System.out System System.out 2 String[] args args public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        if (s.equalsIgnoreCase("SRS")
                || s.equalsIgnoreCase("SSR")
                || s.equalsIgnoreCase("RSS")
                || s.equalsIgnoreCase("RSR")) {
            System.out.println(1);
        }
        else if(!s.contains("R")){
            System.out.println(0);
        }
        else if(s.equalsIgnoreCase("RRR")){
            System.out.println(3);
        }
        else System.out.println(2);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        if (s.equalsIgnoreCase("SRS")
                || s.equalsIgnoreCase("SSR")
                || s.equalsIgnoreCase("RSS")
                || s.equalsIgnoreCase("RSR")) {
            System.out.println(1);
        }
        else if(!s.contains("R")){
            System.out.println(0);
        }
        else if(s.equalsIgnoreCase("RRR")){
            System.out.println(3);
        }
        else System.out.println(2);
    }
} Main

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        if (s.equalsIgnoreCase("SRS")
                || s.equalsIgnoreCase("SSR")
                || s.equalsIgnoreCase("RSS")
                || s.equalsIgnoreCase("RSR")) {
            System.out.println(1);
        }
        else if(!s.contains("R")){
            System.out.println(0);
        }
        else if(s.equalsIgnoreCase("RRR")){
            System.out.println(3);
        }
        else System.out.println(2);
    }
}
