import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

class Main{
  public static void main(String[] args) throws IOException {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char R = 'R';
    char[] chars = s.toCharArray();
    int count;
    if(chars[0] == R && chars[1] == R && chars[2] == R){
      count =3;
    }
    else if( (chars[0] == R && chars[1] == R) || (chars[1] == R && chars[2] == R)){
      count =2;
    }
    else if( chars[0] == R || chars[1] == R || chars[2] == R){
      count =1;
    }
    else{
      count = 0;
    }
    System.out.println(count);
  }

  static class Scanner {
    StringTokenizer st;
    BufferedReader br;

    public Scanner(InputStream s) {
      br = new BufferedReader(new InputStreamReader(s));
    }

    public Scanner(FileReader s) throws FileNotFoundException {
      br = new BufferedReader(s);
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens())
        st = new StringTokenizer(br.readLine());
      return st.nextToken();
    }

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

    public long nextLong() throws IOException {
      return Long.parseLong(next());
    }

    public String nextLine() throws IOException {
      return br.readLine();
    }

    public double nextDouble() throws IOException {
      return Double.parseDouble(next());
    }

    public boolean ready() throws IOException {
      return br.ready();
    }
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.FileNotFoundException; FileNotFoundException java.io import java.io.FileReader; FileReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util class Main{
  public static void main(String[] args) throws IOException {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char R = 'R';
    char[] chars = s.toCharArray();
    int count;
    if(chars[0] == R && chars[1] == R && chars[2] == R){
      count =3;
    }
    else if( (chars[0] == R && chars[1] == R) || (chars[1] == R && chars[2] == R)){
      count =2;
    }
    else if( chars[0] == R || chars[1] == R || chars[2] == R){
      count =1;
    }
    else{
      count = 0;
    }
    System.out.println(count);
  }

  static class Scanner {
    StringTokenizer st;
    BufferedReader br;

    public Scanner(InputStream s) {
      br = new BufferedReader(new InputStreamReader(s));
    }

    public Scanner(FileReader s) throws FileNotFoundException {
      br = new BufferedReader(s);
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens())
        st = new StringTokenizer(br.readLine());
      return st.nextToken();
    }

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

    public long nextLong() throws IOException {
      return Long.parseLong(next());
    }

    public String nextLine() throws IOException {
      return br.readLine();
    }

    public double nextDouble() throws IOException {
      return Double.parseDouble(next());
    }

    public boolean ready() throws IOException {
      return br.ready();
    }
  }
} Main public static void main(String[] args) throws IOException {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char R = 'R';
    char[] chars = s.toCharArray();
    int count;
    if(chars[0] == R && chars[1] == R && chars[2] == R){
      count =3;
    }
    else if( (chars[0] == R && chars[1] == R) || (chars[1] == R && chars[2] == R)){
      count =2;
    }
    else if( chars[0] == R || chars[1] == R || chars[2] == R){
      count =1;
    }
    else{
      count = 0;
    }
    System.out.println(count);
  } main {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char R = 'R';
    char[] chars = s.toCharArray();
    int count;
    if(chars[0] == R && chars[1] == R && chars[2] == R){
      count =3;
    }
    else if( (chars[0] == R && chars[1] == R) || (chars[1] == R && chars[2] == R)){
      count =2;
    }
    else if( chars[0] == R || chars[1] == R || chars[2] == R){
      count =1;
    }
    else{
      count = 0;
    }
    System.out.println(count);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc char R = 'R'; R 'R' char[] chars = s.toCharArray(); chars s.toCharArray() s.toCharArray s int count; count if(chars[0] == R && chars[1] == R && chars[2] == R){
      count =3;
    }
    else if( (chars[0] == R && chars[1] == R) || (chars[1] == R && chars[2] == R)){
      count =2;
    }
    else if( chars[0] == R || chars[1] == R || chars[2] == R){
      count =1;
    }
    else{
      count = 0;
    } chars[0] == R && chars[1] == R && chars[2] == R chars[0] == R && chars[1] == R && chars[2] == R chars[0] == R chars[0] chars 0 R chars[1] == R chars[1] chars 1 R chars[2] == R chars[2] chars 2 R {
      count =3;
    } count =3 count 3 if( (chars[0] == R && chars[1] == R) || (chars[1] == R && chars[2] == R)){
      count =2;
    }
    else if( chars[0] == R || chars[1] == R || chars[2] == R){
      count =1;
    }
    else{
      count = 0;
    } (chars[0] == R && chars[1] == R) || (chars[1] == R && chars[2] == R) (chars[0] == R && chars[1] == R) chars[0] == R chars[0] chars 0 R chars[1] == R chars[1] chars 1 R (chars[1] == R && chars[2] == R) chars[1] == R chars[1] chars 1 R chars[2] == R chars[2] chars 2 R {
      count =2;
    } count =2 count 2 if( chars[0] == R || chars[1] == R || chars[2] == R){
      count =1;
    }
    else{
      count = 0;
    } chars[0] == R || chars[1] == R || chars[2] == R chars[0] == R || chars[1] == R || chars[2] == R chars[0] == R chars[0] chars 0 R chars[1] == R chars[1] chars 1 R chars[2] == R chars[2] chars 2 R {
      count =1;
    } count =1 count 1 {
      count = 0;
    } count = 0 count 0 System.out.println(count) System.out.println System.out System System.out count String[] args args static class Scanner {
    StringTokenizer st;
    BufferedReader br;

    public Scanner(InputStream s) {
      br = new BufferedReader(new InputStreamReader(s));
    }

    public Scanner(FileReader s) throws FileNotFoundException {
      br = new BufferedReader(s);
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens())
        st = new StringTokenizer(br.readLine());
      return st.nextToken();
    }

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

    public long nextLong() throws IOException {
      return Long.parseLong(next());
    }

    public String nextLine() throws IOException {
      return br.readLine();
    }

    public double nextDouble() throws IOException {
      return Double.parseDouble(next());
    }

    public boolean ready() throws IOException {
      return br.ready();
    }
  } Scanner StringTokenizer st; st BufferedReader br; br public Scanner(InputStream s) {
      br = new BufferedReader(new InputStreamReader(s));
    } Scanner {
      br = new BufferedReader(new InputStreamReader(s));
    } br = new BufferedReader(new InputStreamReader(s)) br new BufferedReader(new InputStreamReader(s)) InputStream s s public Scanner(FileReader s) throws FileNotFoundException {
      br = new BufferedReader(s);
    } Scanner {
      br = new BufferedReader(s);
    } br = new BufferedReader(s) br new BufferedReader(s) FileReader s s public String next() throws IOException {
      while (st == null || !st.hasMoreTokens())
        st = new StringTokenizer(br.readLine());
      return st.nextToken();
    } next {
      while (st == null || !st.hasMoreTokens())
        st = new StringTokenizer(br.readLine());
      return st.nextToken();
    } while (st == null || !st.hasMoreTokens())
        st = new StringTokenizer(br.readLine()); st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public int nextInt() throws IOException {
      return Integer.parseInt(next());
    } nextInt {
      return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() throws IOException {
      return Long.parseLong(next());
    } nextLong {
      return Long.parseLong(next());
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public String nextLine() throws IOException {
      return br.readLine();
    } nextLine {
      return br.readLine();
    } return br.readLine(); br.readLine() br.readLine br public double nextDouble() throws IOException {
      return Double.parseDouble(next());
    } nextDouble {
      return Double.parseDouble(next());
    } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public boolean ready() throws IOException {
      return br.ready();
    } ready {
      return br.ready();
    } return br.ready(); br.ready() br.ready br
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

class Main{
  public static void main(String[] args) throws IOException {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    char R = 'R';
    char[] chars = s.toCharArray();
    int count;
    if(chars[0] == R && chars[1] == R && chars[2] == R){
      count =3;
    }
    else if( (chars[0] == R && chars[1] == R) || (chars[1] == R && chars[2] == R)){
      count =2;
    }
    else if( chars[0] == R || chars[1] == R || chars[2] == R){
      count =1;
    }
    else{
      count = 0;
    }
    System.out.println(count);
  }

  static class Scanner {
    StringTokenizer st;
    BufferedReader br;

    public Scanner(InputStream s) {
      br = new BufferedReader(new InputStreamReader(s));
    }

    public Scanner(FileReader s) throws FileNotFoundException {
      br = new BufferedReader(s);
    }

    public String next() throws IOException {
      while (st == null || !st.hasMoreTokens())
        st = new StringTokenizer(br.readLine());
      return st.nextToken();
    }

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

    public long nextLong() throws IOException {
      return Long.parseLong(next());
    }

    public String nextLine() throws IOException {
      return br.readLine();
    }

    public double nextDouble() throws IOException {
      return Double.parseDouble(next());
    }

    public boolean ready() throws IOException {
      return br.ready();
    }
  }
}
