import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    static final FS sc = new FS();  // 封装输入类
    static final PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = sc.next();
        int res = 0;
        for (int i = 0;i < s.length();i++) {
            if (s.charAt(i) == 'R') {
                res++;
            }
        }
        if (res == 3 || res <= 1) {
            pw.println(res);
        } else if (res == 2) {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        }
        pw.flush();
    }

    static class FS {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            }
            return st.nextToken();
        }
        int[] nextArray(int n) {
            int[] a = new int[n];
            for(int i = 0;i < n;i++) {
                a[i] = nextInt();
            }
            return a;
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    static final FS sc = new FS();  // 封装输入类
    static final PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = sc.next();
        int res = 0;
        for (int i = 0;i < s.length();i++) {
            if (s.charAt(i) == 'R') {
                res++;
            }
        }
        if (res == 3 || res <= 1) {
            pw.println(res);
        } else if (res == 2) {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        }
        pw.flush();
    }

    static class FS {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            }
            return st.nextToken();
        }
        int[] nextArray(int n) {
            int[] a = new int[n];
            for(int i = 0;i < n;i++) {
                a[i] = nextInt();
            }
            return a;
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }
} Main static final FS sc = new FS();  // 封装输入类 sc new FS() static final PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) public static void main(String[] args) {
        String s = sc.next();
        int res = 0;
        for (int i = 0;i < s.length();i++) {
            if (s.charAt(i) == 'R') {
                res++;
            }
        }
        if (res == 3 || res <= 1) {
            pw.println(res);
        } else if (res == 2) {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        }
        pw.flush();
    } main {
        String s = sc.next();
        int res = 0;
        for (int i = 0;i < s.length();i++) {
            if (s.charAt(i) == 'R') {
                res++;
            }
        }
        if (res == 3 || res <= 1) {
            pw.println(res);
        } else if (res == 2) {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        }
        pw.flush();
    } String s = sc.next(); s sc.next() sc.next sc int res = 0; res 0 for (int i = 0;i < s.length();i++) {
            if (s.charAt(i) == 'R') {
                res++;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s.charAt(i) == 'R') {
                res++;
            }
        } {
            if (s.charAt(i) == 'R') {
                res++;
            }
        } if (s.charAt(i) == 'R') {
                res++;
            } s.charAt(i) == 'R' s.charAt(i) s.charAt s i 'R' {
                res++;
            } res++ res if (res == 3 || res <= 1) {
            pw.println(res);
        } else if (res == 2) {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        } res == 3 || res <= 1 res == 3 res 3 res <= 1 res 1 {
            pw.println(res);
        } pw.println(res) pw.println pw res if (res == 2) {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        } res == 2 res 2 {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        } if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            } s.charAt(1) == 'R' s.charAt(1) s.charAt s 1 'R' {
                pw.println(2);
            } pw.println(2) pw.println pw 2 {
                pw.println(1);
            } pw.println(1) pw.println pw 1 pw.flush() pw.flush pw String[] args args static class FS {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            }
            return st.nextToken();
        }
        int[] nextArray(int n) {
            int[] a = new int[n];
            for(int i = 0;i < n;i++) {
                a[i] = nextInt();
            }
            return a;
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    } FS BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st = new StringTokenizer(""); st new StringTokenizer("") String next() {
            while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            }
            return st.nextToken();
        } next {
            while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            }
            return st.nextToken();
        } while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            } !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            } try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {} catch(Exception ignored) {} Exception ignored {} {
                    st = new StringTokenizer(br.readLine());
                } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int[] nextArray(int n) {
            int[] a = new int[n];
            for(int i = 0;i < n;i++) {
                a[i] = nextInt();
            }
            return a;
        } nextArray {
            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] = nextInt() a[i] a i nextInt() nextInt return a; a int n n int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public class Main {
    static final FS sc = new FS();  // 封装输入类
    static final PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = sc.next();
        int res = 0;
        for (int i = 0;i < s.length();i++) {
            if (s.charAt(i) == 'R') {
                res++;
            }
        }
        if (res == 3 || res <= 1) {
            pw.println(res);
        } else if (res == 2) {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        }
        pw.flush();
    }

    static class FS {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            }
            return st.nextToken();
        }
        int[] nextArray(int n) {
            int[] a = new int[n];
            for(int i = 0;i < n;i++) {
                a[i] = nextInt();
            }
            return a;
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }
} public class Main {
    static final FS sc = new FS();  // 封装输入类
    static final PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = sc.next();
        int res = 0;
        for (int i = 0;i < s.length();i++) {
            if (s.charAt(i) == 'R') {
                res++;
            }
        }
        if (res == 3 || res <= 1) {
            pw.println(res);
        } else if (res == 2) {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        }
        pw.flush();
    }

    static class FS {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            }
            return st.nextToken();
        }
        int[] nextArray(int n) {
            int[] a = new int[n];
            for(int i = 0;i < n;i++) {
                a[i] = nextInt();
            }
            return a;
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    static final FS sc = new FS();  // 封装输入类
    static final PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = sc.next();
        int res = 0;
        for (int i = 0;i < s.length();i++) {
            if (s.charAt(i) == 'R') {
                res++;
            }
        }
        if (res == 3 || res <= 1) {
            pw.println(res);
        } else if (res == 2) {
            if (s.charAt(1) == 'R') {
                pw.println(2);
            } else {
                pw.println(1);
            }
        }
        pw.flush();
    }

    static class FS {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        String next() {
            while(!st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch(Exception ignored) {}
            }
            return st.nextToken();
        }
        int[] nextArray(int n) {
            int[] a = new int[n];
            for(int i = 0;i < n;i++) {
                a[i] = nextInt();
            }
            return a;
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }
}