import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.lang.Math;
import java.util.Map;
import java.util.ArrayList;
import java.util.Collections;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        String s = fs.next();
        char[] S = s.toCharArray();

        int c = 0;
        boolean rain = false;
        for (int i = 0; i<2; i++) {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        }
        for (int i = 0; i<3;i++) {
            if (S[i] == 'R') {
                rain = true;
            }
        }
        if (rain) {
            System.out.println(c+1);
        } else {
            System.out.println(0);
        }



    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java import java.lang.Math; Math java.lang import java.util.Map; Map java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        String s = fs.next();
        char[] S = s.toCharArray();

        int c = 0;
        boolean rain = false;
        for (int i = 0; i<2; i++) {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        }
        for (int i = 0; i<3;i++) {
            if (S[i] == 'R') {
                rain = true;
            }
        }
        if (rain) {
            System.out.println(c+1);
        } else {
            System.out.println(0);
        }



    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

} Main public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        String s = fs.next();
        char[] S = s.toCharArray();

        int c = 0;
        boolean rain = false;
        for (int i = 0; i<2; i++) {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        }
        for (int i = 0; i<3;i++) {
            if (S[i] == 'R') {
                rain = true;
            }
        }
        if (rain) {
            System.out.println(c+1);
        } else {
            System.out.println(0);
        }



    } main {
        FastScanner fs = new FastScanner();
        String s = fs.next();
        char[] S = s.toCharArray();

        int c = 0;
        boolean rain = false;
        for (int i = 0; i<2; i++) {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        }
        for (int i = 0; i<3;i++) {
            if (S[i] == 'R') {
                rain = true;
            }
        }
        if (rain) {
            System.out.println(c+1);
        } else {
            System.out.println(0);
        }



    } FastScanner fs = new FastScanner(); fs new FastScanner() String s = fs.next(); s fs.next() fs.next fs char[] S = s.toCharArray(); S s.toCharArray() s.toCharArray s int c = 0; c 0 boolean rain = false; rain false for (int i = 0; i<2; i++) {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        } int i = 0; int i = 0; i 0 i<2 i 2 i++ i++ i {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        } {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        } if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            } S[i] == S[i+1] && S[i] == 'R' S[i] == S[i+1] S[i] S i S[i+1] S i+1 i 1 S[i] == 'R' S[i] S i 'R' {
                c++;

            } c++ c for (int i = 0; i<3;i++) {
            if (S[i] == 'R') {
                rain = true;
            }
        } int i = 0; int i = 0; i 0 i<3 i 3 i++ i++ i {
            if (S[i] == 'R') {
                rain = true;
            }
        } {
            if (S[i] == 'R') {
                rain = true;
            }
        } if (S[i] == 'R') {
                rain = true;
            } S[i] == 'R' S[i] S i 'R' {
                rain = true;
            } rain = true rain true if (rain) {
            System.out.println(c+1);
        } else {
            System.out.println(0);
        } rain {
            System.out.println(c+1);
        } System.out.println(c+1) System.out.println System.out System System.out c+1 c 1 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 String[] args args static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    } FastScanner BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st=new StringTokenizer(""); st new StringTokenizer("") public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        } next {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        } while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    st=new StringTokenizer(br.readLine());
                } st=new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        } readArray {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        } int[] a=new int[n]; a new int[n] n for (int i=0; i<n; i++) a[i]=nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i]=nextInt(); a[i]=nextInt() a[i] a i nextInt() nextInt return a; a int n n public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        String s = fs.next();
        char[] S = s.toCharArray();

        int c = 0;
        boolean rain = false;
        for (int i = 0; i<2; i++) {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        }
        for (int i = 0; i<3;i++) {
            if (S[i] == 'R') {
                rain = true;
            }
        }
        if (rain) {
            System.out.println(c+1);
        } else {
            System.out.println(0);
        }



    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

} public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        String s = fs.next();
        char[] S = s.toCharArray();

        int c = 0;
        boolean rain = false;
        for (int i = 0; i<2; i++) {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        }
        for (int i = 0; i<3;i++) {
            if (S[i] == 'R') {
                rain = true;
            }
        }
        if (rain) {
            System.out.println(c+1);
        } else {
            System.out.println(0);
        }



    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.lang.Math;
import java.util.Map;
import java.util.ArrayList;
import java.util.Collections;

public class Main {

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();
        String s = fs.next();
        char[] S = s.toCharArray();

        int c = 0;
        boolean rain = false;
        for (int i = 0; i<2; i++) {
            if (S[i] == S[i+1] && S[i] == 'R') {
                c++;

            }
        }
        for (int i = 0; i<3;i++) {
            if (S[i] == 'R') {
                rain = true;
            }
        }
        if (rain) {
            System.out.println(c+1);
        } else {
            System.out.println(0);
        }



    }


    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");

        public String next() {
            while (!st.hasMoreElements())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
    }

}
