import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        //入力
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        sc.close();

        //分割
        char[] str1 = new char[str.length()];
        for(int i=0; i<str.length(); i++){
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        }


        int count = -1;
        //雨が0連続で降った場合
        if(str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R'){
            count = 0;
        }
        else if((str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R')){
            count = 1;
        }
        else if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        }

        System.out.println(count);

    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        //入力
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        sc.close();

        //分割
        char[] str1 = new char[str.length()];
        for(int i=0; i<str.length(); i++){
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        }


        int count = -1;
        //雨が0連続で降った場合
        if(str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R'){
            count = 0;
        }
        else if((str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R')){
            count = 1;
        }
        else if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        }

        System.out.println(count);

    }
} Main public static void main(String[] args){
        //入力
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        sc.close();

        //分割
        char[] str1 = new char[str.length()];
        for(int i=0; i<str.length(); i++){
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        }


        int count = -1;
        //雨が0連続で降った場合
        if(str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R'){
            count = 0;
        }
        else if((str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R')){
            count = 1;
        }
        else if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        }

        System.out.println(count);

    } main {
        //入力
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        sc.close();

        //分割
        char[] str1 = new char[str.length()];
        for(int i=0; i<str.length(); i++){
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        }


        int count = -1;
        //雨が0連続で降った場合
        if(str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R'){
            count = 0;
        }
        else if((str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R')){
            count = 1;
        }
        else if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        }

        System.out.println(count);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc sc.close() sc.close sc char[] str1 = new char[str.length()]; str1 new char[str.length()] str.length() str.length str for(int i=0; i<str.length(); i++){
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        } int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        } {
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        } str1[i] = str.charAt(i) str1[i] str1 i str.charAt(i) str.charAt str i int count = -1; count -1 1 if(str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R'){
            count = 0;
        }
        else if((str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R')){
            count = 1;
        }
        else if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        } str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R' str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R' str1[0] != 'R' str1[0] str1 0 'R' str1[1] != 'R' str1[1] str1 1 'R' str1[2] != 'R' str1[2] str1 2 'R' {
            count = 0;
        } count = 0 count 0 if((str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R')){
            count = 1;
        }
        else if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        } (str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R') (str1[2] == 'S' && str1[0] == 'S') (str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R') (str1[0] == 'S' && str1[1] == 'S') str1[0] == 'S' str1[0] str1 0 'S' str1[1] == 'S' str1[1] str1 1 'S' (str1[1] == 'S' && str1[2] == 'S') str1[1] == 'S' str1[1] str1 1 'S' str1[2] == 'S' str1[2] str1 2 'S' (str1[2] == 'S' && str1[0] == 'S') str1[2] == 'S' str1[2] str1 2 'S' str1[0] == 'S' str1[0] str1 0 'S' (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R') str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R' str1[0] == 'R' str1[0] str1 0 'R' str1[1] == 'S' str1[1] str1 1 'S' str1[2] == 'R' str1[2] str1 2 'R' {
            count = 1;
        } count = 1 count 1 if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        } (str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R') (str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S' str1[0] == 'R' str1[0] str1 0 'R' str1[1] == 'R' str1[1] str1 1 'R' str1[2] == 'S' str1[2] str1 2 'S' (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R') str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R' str1[0] == 'S' str1[0] str1 0 'S' str1[1] == 'R' str1[1] str1 1 'R' str1[2] == 'R' str1[2] str1 2 'R' {
            count = 2;
        } count = 2 count 2 if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        } str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R' str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R' str1[0] == 'R' str1[0] str1 0 'R' str1[1] == 'R' str1[1] str1 1 'R' str1[2] == 'R' str1[2] str1 2 'R' {
            count = 3;
        } count = 3 count 3 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{
    public static void main(String[] args){
        //入力
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        sc.close();

        //分割
        char[] str1 = new char[str.length()];
        for(int i=0; i<str.length(); i++){
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        }


        int count = -1;
        //雨が0連続で降った場合
        if(str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R'){
            count = 0;
        }
        else if((str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R')){
            count = 1;
        }
        else if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        }

        System.out.println(count);

    }
} public class Main{
    public static void main(String[] args){
        //入力
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        sc.close();

        //分割
        char[] str1 = new char[str.length()];
        for(int i=0; i<str.length(); i++){
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        }


        int count = -1;
        //雨が0連続で降った場合
        if(str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R'){
            count = 0;
        }
        else if((str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R')){
            count = 1;
        }
        else if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        }

        System.out.println(count);

    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        //入力
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        sc.close();

        //分割
        char[] str1 = new char[str.length()];
        for(int i=0; i<str.length(); i++){
            str1[i] = str.charAt(i);
            //System.out.println(str1[i]);
        }


        int count = -1;
        //雨が0連続で降った場合
        if(str1[0] != 'R' && str1[1] != 'R' && str1[2] != 'R'){
            count = 0;
        }
        else if((str1[0] == 'S' && str1[1] == 'S') || (str1[1] == 'S' && str1[2] == 'S') || (str1[2] == 'S' && str1[0] == 'S') || (str1[0] == 'R' && str1[1] == 'S' && str1[2] == 'R')){
            count = 1;
        }
        else if((str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'S') || (str1[0] == 'S' && str1[1] == 'R' && str1[2] == 'R')){
            count = 2;
        }
        else if(str1[0] == 'R' && str1[1] == 'R' && str1[2] == 'R'){
            count = 3;
        }

        System.out.println(count);

    }
}