import java.util.*;

public class Main {

    public static void main(String args[]) {


        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        char a = s.charAt(0);
        char b = s.charAt(1);
        char c = s.charAt(2);

        if (a == 'R') {
            if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            }
        } else {
            if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            }
        }

    }
} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {


        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        char a = s.charAt(0);
        char b = s.charAt(1);
        char c = s.charAt(2);

        if (a == 'R') {
            if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            }
        } else {
            if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            }
        }

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


        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        char a = s.charAt(0);
        char b = s.charAt(1);
        char c = s.charAt(2);

        if (a == 'R') {
            if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            }
        } else {
            if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            }
        }

    } main {


        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        char a = s.charAt(0);
        char b = s.charAt(1);
        char c = s.charAt(2);

        if (a == 'R') {
            if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            }
        } else {
            if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            }
        }

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan char a = s.charAt(0); a s.charAt(0) s.charAt s 0 char b = s.charAt(1); b s.charAt(1) s.charAt s 1 char c = s.charAt(2); c s.charAt(2) s.charAt s 2 if (a == 'R') {
            if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            }
        } else {
            if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            }
        } a == 'R' a 'R' {
            if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            }
        } if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            } b== 'R' b 'R' {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            } if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                } c == 'R' c 'R' {
                    System.out.println(3);
                } System.out.println(3) System.out.println System.out System System.out 3 {
                    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 {
            if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            }
        } if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            } b== 'R' b 'R' {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                } c== 'R' c 'R' {
                    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 {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            } if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                } c=='R' c 'R' {
                    System.out.println(1);
                } System.out.println(1) System.out.println System.out System System.out 1 {
                    System.out.println(0);
                } System.out.println(0) System.out.println System.out System System.out 0 String args[] args public class Main {

    public static void main(String args[]) {


        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        char a = s.charAt(0);
        char b = s.charAt(1);
        char c = s.charAt(2);

        if (a == 'R') {
            if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            }
        } else {
            if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            }
        }

    }
} public class Main {

    public static void main(String args[]) {


        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        char a = s.charAt(0);
        char b = s.charAt(1);
        char c = s.charAt(2);

        if (a == 'R') {
            if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            }
        } else {
            if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            }
        }

    }
} Main
import java.util.*;

public class Main {

    public static void main(String args[]) {


        Scanner scan = new Scanner(System.in);
        String s = scan.next();

        char a = s.charAt(0);
        char b = s.charAt(1);
        char c = s.charAt(2);

        if (a == 'R') {
            if (b== 'R') {

                if (c == 'R') {
                    System.out.println(3);
                } else {
                    System.out.println(2);
                }
            }  else {
                System.out.println(1);
            }
        } else {
            if (b== 'R') {
                if (c== 'R') {
                    System.out.println(2);
                } else {
                    System.out.println(1);
                }
            } else {
                if (c=='R') {
                    System.out.println(1);
                } else {
                    System.out.println(0);
                }
            }
        }

    }
}