import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s =new Scanner(System.in);
        String input=s.nextLine();
        List<Character> cl=new ArrayList<>();
        for(int i=0;i<input.length();i++){
            cl.add(input.charAt(i));
        }
        boolean flag=false;

        if(Collections.frequency(cl,'S')==3){
            System.out.println("0");
        }
        else if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        }

    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner s =new Scanner(System.in);
        String input=s.nextLine();
        List<Character> cl=new ArrayList<>();
        for(int i=0;i<input.length();i++){
            cl.add(input.charAt(i));
        }
        boolean flag=false;

        if(Collections.frequency(cl,'S')==3){
            System.out.println("0");
        }
        else if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        }

    }
} Main public static void main(String[] args) {
        Scanner s =new Scanner(System.in);
        String input=s.nextLine();
        List<Character> cl=new ArrayList<>();
        for(int i=0;i<input.length();i++){
            cl.add(input.charAt(i));
        }
        boolean flag=false;

        if(Collections.frequency(cl,'S')==3){
            System.out.println("0");
        }
        else if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        }

    } main {
        Scanner s =new Scanner(System.in);
        String input=s.nextLine();
        List<Character> cl=new ArrayList<>();
        for(int i=0;i<input.length();i++){
            cl.add(input.charAt(i));
        }
        boolean flag=false;

        if(Collections.frequency(cl,'S')==3){
            System.out.println("0");
        }
        else if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        }

    } Scanner s =new Scanner(System.in); s new Scanner(System.in) String input=s.nextLine(); input s.nextLine() s.nextLine s List<Character> cl=new ArrayList<>(); cl new ArrayList<>() for(int i=0;i<input.length();i++){
            cl.add(input.charAt(i));
        } int i=0; int i=0; i 0 i<input.length() i input.length() input.length input i++ i++ i {
            cl.add(input.charAt(i));
        } {
            cl.add(input.charAt(i));
        } cl.add(input.charAt(i)) cl.add cl input.charAt(i) input.charAt input i boolean flag=false; flag false if(Collections.frequency(cl,'S')==3){
            System.out.println("0");
        }
        else if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        } Collections.frequency(cl,'S')==3 Collections.frequency(cl,'S') Collections.frequency Collections cl 'S' 3 {
            System.out.println("0");
        } System.out.println("0") System.out.println System.out System System.out "0" if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        } Collections.frequency(cl,'R')==3 Collections.frequency(cl,'R') Collections.frequency Collections cl 'R' 3 {
           System.out.println("3");
        } System.out.println("3") System.out.println System.out System System.out "3" {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        } for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            } int i=0; int i=0; i 0 i<input.length()-1 i input.length()-1 input.length() input.length input 1 i++ i++ i {
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            } {
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            } if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                } cl.get(i)=='R' && cl.get(i+1)=='R' cl.get(i)=='R' cl.get(i) cl.get cl i 'R' cl.get(i+1)=='R' cl.get(i+1) cl.get cl i+1 i 1 'R' {
                    flag=true;
                } flag=true flag true if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            } flag==true flag true {
                System.out.println("2");
            } System.out.println("2") System.out.println System.out System System.out "2" {
                System.out.println("1");
            } System.out.println("1") System.out.println System.out System System.out "1" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner s =new Scanner(System.in);
        String input=s.nextLine();
        List<Character> cl=new ArrayList<>();
        for(int i=0;i<input.length();i++){
            cl.add(input.charAt(i));
        }
        boolean flag=false;

        if(Collections.frequency(cl,'S')==3){
            System.out.println("0");
        }
        else if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        }

    }
} public class Main {
    public static void main(String[] args) {
        Scanner s =new Scanner(System.in);
        String input=s.nextLine();
        List<Character> cl=new ArrayList<>();
        for(int i=0;i<input.length();i++){
            cl.add(input.charAt(i));
        }
        boolean flag=false;

        if(Collections.frequency(cl,'S')==3){
            System.out.println("0");
        }
        else if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        }

    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s =new Scanner(System.in);
        String input=s.nextLine();
        List<Character> cl=new ArrayList<>();
        for(int i=0;i<input.length();i++){
            cl.add(input.charAt(i));
        }
        boolean flag=false;

        if(Collections.frequency(cl,'S')==3){
            System.out.println("0");
        }
        else if(Collections.frequency(cl,'R')==3){
           System.out.println("3");
        }
        else {
            for(int i=0;i<input.length()-1;i++){
                if(cl.get(i)=='R' && cl.get(i+1)=='R'){
                    flag=true;
                }
            }
            if(flag==true){
                System.out.println("2");
            }
            else
            {
                System.out.println("1");
            }

        }

    }
}
