import java.util.*;
public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();



        int c = 0;
        switch (S){
            case("RRR"): c=3; break;
            case("SSS"): c=0; break;
            case("RRS"): c=2; break;
            case("SRR"): c=2; break;
            default: c=1; break;
        }



        System.out.println(c);

    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();



        int c = 0;
        switch (S){
            case("RRR"): c=3; break;
            case("SSS"): c=0; break;
            case("RRS"): c=2; break;
            case("SRR"): c=2; break;
            default: c=1; break;
        }



        System.out.println(c);

    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();



        int c = 0;
        switch (S){
            case("RRR"): c=3; break;
            case("SSS"): c=0; break;
            case("RRS"): c=2; break;
            case("SRR"): c=2; break;
            default: c=1; break;
        }



        System.out.println(c);

    } main {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();



        int c = 0;
        switch (S){
            case("RRR"): c=3; break;
            case("SSS"): c=0; break;
            case("RRS"): c=2; break;
            case("SRR"): c=2; break;
            default: c=1; break;
        }



        System.out.println(c);

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

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();



        int c = 0;
        switch (S){
            case("RRR"): c=3; break;
            case("SSS"): c=0; break;
            case("RRS"): c=2; break;
            case("SRR"): c=2; break;
            default: c=1; break;
        }



        System.out.println(c);

    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();



        int c = 0;
        switch (S){
            case("RRR"): c=3; break;
            case("SSS"): c=0; break;
            case("RRS"): c=2; break;
            case("SRR"): c=2; break;
            default: c=1; break;
        }



        System.out.println(c);

    }
} Main
import java.util.*;
public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();



        int c = 0;
        switch (S){
            case("RRR"): c=3; break;
            case("SSS"): c=0; break;
            case("RRS"): c=2; break;
            case("SRR"): c=2; break;
            default: c=1; break;
        }



        System.out.println(c);

    }
}