import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        String  x = scan.next();
        String a,b,c ;
        a = x.substring(0,1);
        b = x.substring(1,2);
        c = x.substring(2,3);
        if(a.equals("R") && b.equals("R") && c.equals("R")){
            System.out.println("3");
        }else if(a.equals("R") && b.equals("R") && c.equals("S")){
            System.out.println("2");
        }else if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        }

    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        String  x = scan.next();
        String a,b,c ;
        a = x.substring(0,1);
        b = x.substring(1,2);
        c = x.substring(2,3);
        if(a.equals("R") && b.equals("R") && c.equals("R")){
            System.out.println("3");
        }else if(a.equals("R") && b.equals("R") && c.equals("S")){
            System.out.println("2");
        }else if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        }

    }
} Main public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        String  x = scan.next();
        String a,b,c ;
        a = x.substring(0,1);
        b = x.substring(1,2);
        c = x.substring(2,3);
        if(a.equals("R") && b.equals("R") && c.equals("R")){
            System.out.println("3");
        }else if(a.equals("R") && b.equals("R") && c.equals("S")){
            System.out.println("2");
        }else if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        }

    } main {
        Scanner scan = new Scanner(System.in);
        String  x = scan.next();
        String a,b,c ;
        a = x.substring(0,1);
        b = x.substring(1,2);
        c = x.substring(2,3);
        if(a.equals("R") && b.equals("R") && c.equals("R")){
            System.out.println("3");
        }else if(a.equals("R") && b.equals("R") && c.equals("S")){
            System.out.println("2");
        }else if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        }

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String  x = scan.next(); x scan.next() scan.next scan String a a b b c ; c a = x.substring(0,1) a x.substring(0,1) x.substring x 0 1 b = x.substring(1,2) b x.substring(1,2) x.substring x 1 2 c = x.substring(2,3) c x.substring(2,3) x.substring x 2 3 if(a.equals("R") && b.equals("R") && c.equals("R")){
            System.out.println("3");
        }else if(a.equals("R") && b.equals("R") && c.equals("S")){
            System.out.println("2");
        }else if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        } a.equals("R") && b.equals("R") && c.equals("R") a.equals("R") && b.equals("R") && c.equals("R") a.equals("R") a.equals a "R" b.equals("R") b.equals b "R" c.equals("R") c.equals c "R" {
            System.out.println("3");
        } System.out.println("3") System.out.println System.out System System.out "3" if(a.equals("R") && b.equals("R") && c.equals("S")){
            System.out.println("2");
        }else if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        } a.equals("R") && b.equals("R") && c.equals("S") a.equals("R") && b.equals("R") && c.equals("S") a.equals("R") a.equals a "R" b.equals("R") b.equals b "R" c.equals("S") c.equals c "S" {
            System.out.println("2");
        } System.out.println("2") System.out.println System.out System System.out "2" if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        } a.equals("S") && b.equals("R") && c.equals("R") a.equals("S") && b.equals("R") && c.equals("R") a.equals("S") a.equals a "S" b.equals("R") b.equals b "R" c.equals("R") c.equals c "R" {
            System.out.println("2");
        } System.out.println("2") System.out.println System.out System System.out "2" if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        } a.equals("R") && b.equals("S") && c.equals("S") a.equals("R") && b.equals("S") && c.equals("S") a.equals("R") a.equals a "R" b.equals("S") b.equals b "S" c.equals("S") c.equals c "S" {
            System.out.println("1");
        } System.out.println("1") System.out.println System.out System System.out "1" if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        } a.equals("S") && b.equals("R") && c.equals("S") a.equals("S") && b.equals("R") && c.equals("S") a.equals("S") a.equals a "S" b.equals("R") b.equals b "R" c.equals("S") c.equals c "S" {
            System.out.println("1");
        } System.out.println("1") System.out.println System.out System System.out "1" if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        } a.equals("S") && b.equals("S") && c.equals("R") a.equals("S") && b.equals("S") && c.equals("R") a.equals("S") a.equals a "S" b.equals("S") b.equals b "S" c.equals("R") c.equals c "R" {
            System.out.println("1");
        } System.out.println("1") System.out.println System.out System System.out "1" if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        } a.equals("R") && b.equals("S") && c.equals("R") a.equals("R") && b.equals("S") && c.equals("R") a.equals("R") a.equals a "R" b.equals("S") b.equals b "S" c.equals("R") c.equals c "R" {
            System.out.println("1");
        } System.out.println("1") System.out.println System.out System System.out "1" if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        } a.equals("S") && b.equals("S") && c.equals("S") a.equals("S") && b.equals("S") && c.equals("S") a.equals("S") a.equals a "S" b.equals("S") b.equals b "S" c.equals("S") c.equals c "S" {
            System.out.println("0");

        } System.out.println("0") System.out.println System.out System System.out "0" {

        } String args[] args public class Main{
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        String  x = scan.next();
        String a,b,c ;
        a = x.substring(0,1);
        b = x.substring(1,2);
        c = x.substring(2,3);
        if(a.equals("R") && b.equals("R") && c.equals("R")){
            System.out.println("3");
        }else if(a.equals("R") && b.equals("R") && c.equals("S")){
            System.out.println("2");
        }else if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        }

    }
} public class Main{
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        String  x = scan.next();
        String a,b,c ;
        a = x.substring(0,1);
        b = x.substring(1,2);
        c = x.substring(2,3);
        if(a.equals("R") && b.equals("R") && c.equals("R")){
            System.out.println("3");
        }else if(a.equals("R") && b.equals("R") && c.equals("S")){
            System.out.println("2");
        }else if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        }

    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        String  x = scan.next();
        String a,b,c ;
        a = x.substring(0,1);
        b = x.substring(1,2);
        c = x.substring(2,3);
        if(a.equals("R") && b.equals("R") && c.equals("R")){
            System.out.println("3");
        }else if(a.equals("R") && b.equals("R") && c.equals("S")){
            System.out.println("2");
        }else if(a.equals("S") && b.equals("R") && c.equals("R")){
            System.out.println("2");
        }else if(a.equals("R") && b.equals("S") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("R") && c.equals("S")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("R") && b.equals("S") && c.equals("R")){
            System.out.println("1");
        }else if(a.equals("S") && b.equals("S") && c.equals("S")){
            System.out.println("0");

        }else{

        }

    }
}