import java.util.Scanner;

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

    private static void test_mine(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        int count = 0;
        if(s.charAt(1) == 'S'){
            if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0;
        }else{
            if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1;
            }
        System.out.println(count);
    }

    private static void test_ans(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        
        boolean p = s.charAt(0) == 'R';
        boolean q = s.charAt(1) == 'R';
        boolean r = s.charAt(2) == 'R';

        int count = 0;
        if(p && q && r)
            count = 3;
        else if((p && q) || (q && r))
            count = 2;
        else if(p || q || r)
            count = 1;
        else
            count = 0;

        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String args[]){
      test_ans();
    }

    private static void test_mine(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        int count = 0;
        if(s.charAt(1) == 'S'){
            if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0;
        }else{
            if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1;
            }
        System.out.println(count);
    }

    private static void test_ans(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        
        boolean p = s.charAt(0) == 'R';
        boolean q = s.charAt(1) == 'R';
        boolean r = s.charAt(2) == 'R';

        int count = 0;
        if(p && q && r)
            count = 3;
        else if((p && q) || (q && r))
            count = 2;
        else if(p || q || r)
            count = 1;
        else
            count = 0;

        System.out.println(count);
    }
} Main public static void main(String args[]){
      test_ans();
    } main {
      test_ans();
    } test_ans() test_ans String args[] args private static void test_mine(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        int count = 0;
        if(s.charAt(1) == 'S'){
            if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0;
        }else{
            if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1;
            }
        System.out.println(count);
    } test_mine {
        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        int count = 0;
        if(s.charAt(1) == 'S'){
            if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0;
        }else{
            if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1;
            }
        System.out.println(count);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan int count = 0; count 0 if(s.charAt(1) == 'S'){
            if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0;
        }else{
            if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1;
            } s.charAt(1) == 'S' s.charAt(1) s.charAt s 1 'S' {
            if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0;
        } if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0; s.charAt(0) == 'R' || s.charAt(2) == 'R' s.charAt(0) == 'R' s.charAt(0) s.charAt s 0 'R' s.charAt(2) == 'R' s.charAt(2) s.charAt s 2 'R' count = 1 count 1 count = 0 count 0 {
            if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1;
            } if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1; s.charAt(0) == 'R' s.charAt(0) s.charAt s 0 'R' {
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            } if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                } s.charAt(2) == 'R' s.charAt(2) s.charAt s 2 'R' {
                    count = 3;
                } count = 3 count 3 {
                    count = 2;
                } count = 2 count 2 if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1; s.charAt(2) == 'R' s.charAt(2) s.charAt s 2 'R' {
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            } if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                } s.charAt(0) == 'R' s.charAt(0) s.charAt s 0 'R' {
                    count = 3;
                } count = 3 count 3 {
                    count = 2;
                } count = 2 count 2 count = 1 count 1 System.out.println(count) System.out.println System.out System System.out count private static void test_ans(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        
        boolean p = s.charAt(0) == 'R';
        boolean q = s.charAt(1) == 'R';
        boolean r = s.charAt(2) == 'R';

        int count = 0;
        if(p && q && r)
            count = 3;
        else if((p && q) || (q && r))
            count = 2;
        else if(p || q || r)
            count = 1;
        else
            count = 0;

        System.out.println(count);
    } test_ans {
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        
        boolean p = s.charAt(0) == 'R';
        boolean q = s.charAt(1) == 'R';
        boolean r = s.charAt(2) == 'R';

        int count = 0;
        if(p && q && r)
            count = 3;
        else if((p && q) || (q && r))
            count = 2;
        else if(p || q || r)
            count = 1;
        else
            count = 0;

        System.out.println(count);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan boolean p = s.charAt(0) == 'R'; p s.charAt(0) == 'R' s.charAt(0) s.charAt s 0 'R' boolean q = s.charAt(1) == 'R'; q s.charAt(1) == 'R' s.charAt(1) s.charAt s 1 'R' boolean r = s.charAt(2) == 'R'; r s.charAt(2) == 'R' s.charAt(2) s.charAt s 2 'R' int count = 0; count 0 if(p && q && r)
            count = 3;
        else if((p && q) || (q && r))
            count = 2;
        else if(p || q || r)
            count = 1;
        else
            count = 0; p && q && r p && q && r p q r count = 3 count 3 if((p && q) || (q && r))
            count = 2;
        else if(p || q || r)
            count = 1;
        else
            count = 0; (p && q) || (q && r) (p && q) p q (q && r) q r count = 2 count 2 if(p || q || r)
            count = 1;
        else
            count = 0; p || q || r p || q || r p q r count = 1 count 1 count = 0 count 0 System.out.println(count) System.out.println System.out System System.out count public class Main{
	public static void main(String args[]){
      test_ans();
    }

    private static void test_mine(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        int count = 0;
        if(s.charAt(1) == 'S'){
            if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0;
        }else{
            if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1;
            }
        System.out.println(count);
    }

    private static void test_ans(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        
        boolean p = s.charAt(0) == 'R';
        boolean q = s.charAt(1) == 'R';
        boolean r = s.charAt(2) == 'R';

        int count = 0;
        if(p && q && r)
            count = 3;
        else if((p && q) || (q && r))
            count = 2;
        else if(p || q || r)
            count = 1;
        else
            count = 0;

        System.out.println(count);
    }
} public class Main{
	public static void main(String args[]){
      test_ans();
    }

    private static void test_mine(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        int count = 0;
        if(s.charAt(1) == 'S'){
            if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0;
        }else{
            if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1;
            }
        System.out.println(count);
    }

    private static void test_ans(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        
        boolean p = s.charAt(0) == 'R';
        boolean q = s.charAt(1) == 'R';
        boolean r = s.charAt(2) == 'R';

        int count = 0;
        if(p && q && r)
            count = 3;
        else if((p && q) || (q && r))
            count = 2;
        else if(p || q || r)
            count = 1;
        else
            count = 0;

        System.out.println(count);
    }
} Main
import java.util.Scanner;

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

    private static void test_mine(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        int count = 0;
        if(s.charAt(1) == 'S'){
            if(s.charAt(0) == 'R' || s.charAt(2) == 'R')
                count = 1;
            else
                count = 0;
        }else{
            if(s.charAt(0) == 'R'){
                if(s.charAt(2) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else if(s.charAt(2) == 'R'){
                if(s.charAt(0) == 'R'){
                    count = 3;
                }else{
                    count = 2;
                }
            }else
                count = 1;
            }
        System.out.println(count);
    }

    private static void test_ans(){
        Scanner scan = new Scanner(System.in);
        String s = scan.next();
        
        boolean p = s.charAt(0) == 'R';
        boolean q = s.charAt(1) == 'R';
        boolean r = s.charAt(2) == 'R';

        int count = 0;
        if(p && q && r)
            count = 3;
        else if((p && q) || (q && r))
            count = 2;
        else if(p || q || r)
            count = 1;
        else
            count = 0;

        System.out.println(count);
    }
}