import java.util.*;
import java.io.*;
class Main{
  public static void main(String args[])throws IOException{
    char c1=readC(),c2=readC(),c3=readC();
    if(c1=='R'&&c2=='R'&&c3=='R'){
      pl("3");
    }else if((c1=='R'&&c2=='R')||(c3=='R'&&c2=='R')){
      pl("2");
    }else if(c1=='R'||c2=='R'||c3=='R'){
      pl("1");
    }else{
      pl("0");
    }
  }

  static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  public static void pr(String str){
    System.out.print(str);
  }
  public static void pl(String str){
    System.out.println(str);
  }
  public static String read(){
    try{
      return ctos((char)br.read());
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static char readC(){
    try{
      return (char)br.read();
    }catch(IOException e){
      e.printStackTrace();
      return (char)-1;
    }
  }
  public static String readL(){
    try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static String readS(){
    StringBuilder sb = new StringBuilder();
    while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    }
    return sb.toString();
  }
  public static int readI(){
    return stoi(readS());
  }
  public static long readLong(){
    return stol(readS());
  }
  public static long stol(String s){
    return Long.parseLong(s);
  }
  public static String[] readSs(){
    return readL().split(" ");
  }
  public static int[] readIs(){
    return stoi(readSs());
  }
  public static int stoi(String s){
    return Integer.parseInt(s);
  }
  public static int[] stoi(String s[]){
    int a[]=new int[s.length];
    for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    }
    return a;
  }
  public static String itos(int i){
    return String.valueOf(i);
  }
  public static String[] itos(int[] a){
    String s[]=new String[a.length];
    for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    }
    return s;
  }
  public static String ctos(char c){
    return String.valueOf(c);
  }
  public static String cstos(char[] c){
    return new String(c);
  }
  public static char stoc(String s){
    return s.charAt(0);
  }
  public static char[] stocs(String s){
    return s.toCharArray();
  }
} import java.util.*; util.* java import java.io.*; io.* java class Main{
  public static void main(String args[])throws IOException{
    char c1=readC(),c2=readC(),c3=readC();
    if(c1=='R'&&c2=='R'&&c3=='R'){
      pl("3");
    }else if((c1=='R'&&c2=='R')||(c3=='R'&&c2=='R')){
      pl("2");
    }else if(c1=='R'||c2=='R'||c3=='R'){
      pl("1");
    }else{
      pl("0");
    }
  }

  static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  public static void pr(String str){
    System.out.print(str);
  }
  public static void pl(String str){
    System.out.println(str);
  }
  public static String read(){
    try{
      return ctos((char)br.read());
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static char readC(){
    try{
      return (char)br.read();
    }catch(IOException e){
      e.printStackTrace();
      return (char)-1;
    }
  }
  public static String readL(){
    try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static String readS(){
    StringBuilder sb = new StringBuilder();
    while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    }
    return sb.toString();
  }
  public static int readI(){
    return stoi(readS());
  }
  public static long readLong(){
    return stol(readS());
  }
  public static long stol(String s){
    return Long.parseLong(s);
  }
  public static String[] readSs(){
    return readL().split(" ");
  }
  public static int[] readIs(){
    return stoi(readSs());
  }
  public static int stoi(String s){
    return Integer.parseInt(s);
  }
  public static int[] stoi(String s[]){
    int a[]=new int[s.length];
    for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    }
    return a;
  }
  public static String itos(int i){
    return String.valueOf(i);
  }
  public static String[] itos(int[] a){
    String s[]=new String[a.length];
    for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    }
    return s;
  }
  public static String ctos(char c){
    return String.valueOf(c);
  }
  public static String cstos(char[] c){
    return new String(c);
  }
  public static char stoc(String s){
    return s.charAt(0);
  }
  public static char[] stocs(String s){
    return s.toCharArray();
  }
} Main static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) public static void main(String args[])throws IOException{
    char c1=readC(),c2=readC(),c3=readC();
    if(c1=='R'&&c2=='R'&&c3=='R'){
      pl("3");
    }else if((c1=='R'&&c2=='R')||(c3=='R'&&c2=='R')){
      pl("2");
    }else if(c1=='R'||c2=='R'||c3=='R'){
      pl("1");
    }else{
      pl("0");
    }
  } main {
    char c1=readC(),c2=readC(),c3=readC();
    if(c1=='R'&&c2=='R'&&c3=='R'){
      pl("3");
    }else if((c1=='R'&&c2=='R')||(c3=='R'&&c2=='R')){
      pl("2");
    }else if(c1=='R'||c2=='R'||c3=='R'){
      pl("1");
    }else{
      pl("0");
    }
  } char c1=readC() c1 readC() readC c2=readC() c2 readC() readC c3=readC(); c3 readC() readC if(c1=='R'&&c2=='R'&&c3=='R'){
      pl("3");
    }else if((c1=='R'&&c2=='R')||(c3=='R'&&c2=='R')){
      pl("2");
    }else if(c1=='R'||c2=='R'||c3=='R'){
      pl("1");
    }else{
      pl("0");
    } c1=='R'&&c2=='R'&&c3=='R' c1=='R'&&c2=='R'&&c3=='R' c1=='R' c1 'R' c2=='R' c2 'R' c3=='R' c3 'R' {
      pl("3");
    } pl("3") pl "3" if((c1=='R'&&c2=='R')||(c3=='R'&&c2=='R')){
      pl("2");
    }else if(c1=='R'||c2=='R'||c3=='R'){
      pl("1");
    }else{
      pl("0");
    } (c1=='R'&&c2=='R')||(c3=='R'&&c2=='R') (c1=='R'&&c2=='R') c1=='R' c1 'R' c2=='R' c2 'R' (c3=='R'&&c2=='R') c3=='R' c3 'R' c2=='R' c2 'R' {
      pl("2");
    } pl("2") pl "2" if(c1=='R'||c2=='R'||c3=='R'){
      pl("1");
    }else{
      pl("0");
    } c1=='R'||c2=='R'||c3=='R' c1=='R'||c2=='R'||c3=='R' c1=='R' c1 'R' c2=='R' c2 'R' c3=='R' c3 'R' {
      pl("1");
    } pl("1") pl "1" {
      pl("0");
    } pl("0") pl "0" String args[] args public static void pr(String str){
    System.out.print(str);
  } pr {
    System.out.print(str);
  } System.out.print(str) System.out.print System.out System System.out str String str str public static void pl(String str){
    System.out.println(str);
  } pl {
    System.out.println(str);
  } System.out.println(str) System.out.println System.out System System.out str String str str public static String read(){
    try{
      return ctos((char)br.read());
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  } read {
    try{
      return ctos((char)br.read());
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  } try{
      return ctos((char)br.read());
    }catch(IOException e){
      e.printStackTrace();
      return "";
    } catch(IOException e){
      e.printStackTrace();
      return "";
    } IOException e {
      e.printStackTrace();
      return "";
    } e.printStackTrace() e.printStackTrace e return ""; "" {
      return ctos((char)br.read());
    } return ctos((char)br.read()); ctos((char)br.read()) ctos (char)br.read() br.read br public static char readC(){
    try{
      return (char)br.read();
    }catch(IOException e){
      e.printStackTrace();
      return (char)-1;
    }
  } readC {
    try{
      return (char)br.read();
    }catch(IOException e){
      e.printStackTrace();
      return (char)-1;
    }
  } try{
      return (char)br.read();
    }catch(IOException e){
      e.printStackTrace();
      return (char)-1;
    } catch(IOException e){
      e.printStackTrace();
      return (char)-1;
    } IOException e {
      e.printStackTrace();
      return (char)-1;
    } e.printStackTrace() e.printStackTrace e return (char)-1; (char)-1 1 {
      return (char)br.read();
    } return (char)br.read(); (char)br.read() br.read br public static String readL(){
    try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  } readL {
    try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  } try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    } catch(IOException e){
      e.printStackTrace();
      return "";
    } IOException e {
      e.printStackTrace();
      return "";
    } e.printStackTrace() e.printStackTrace e return ""; "" {
      return br.readLine();
    } return br.readLine(); br.readLine() br.readLine br public static String readS(){
    StringBuilder sb = new StringBuilder();
    while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    }
    return sb.toString();
  } readS {
    StringBuilder sb = new StringBuilder();
    while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    }
    return sb.toString();
  } StringBuilder sb = new StringBuilder(); sb new StringBuilder() while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    } true {
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    } try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      } catch(IOException e){
        e.printStackTrace();
      } IOException e {
        e.printStackTrace();
      } e.printStackTrace() e.printStackTrace e {
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      } int k = br.read(); k br.read() br.read br if(k==-1||(char)k==' '||(char)k=='\n'){break;} k==-1||(char)k==' '||(char)k=='\n' k==-1||(char)k==' '||(char)k=='\n' k==-1 k -1 1 (char)k==' ' (char)k ' ' (char)k=='\n' (char)k '\n' {break;} break; sb.append((char)k) sb.append sb (char)k return sb.toString(); sb.toString() sb.toString sb public static int readI(){
    return stoi(readS());
  } readI {
    return stoi(readS());
  } return stoi(readS()); stoi(readS()) stoi readS() readS public static long readLong(){
    return stol(readS());
  } readLong {
    return stol(readS());
  } return stol(readS()); stol(readS()) stol readS() readS public static long stol(String s){
    return Long.parseLong(s);
  } stol {
    return Long.parseLong(s);
  } return Long.parseLong(s); Long.parseLong(s) Long.parseLong Long s String s s public static String[] readSs(){
    return readL().split(" ");
  } readSs {
    return readL().split(" ");
  } return readL().split(" "); readL().split(" ") readL().split readL() readL " " public static int[] readIs(){
    return stoi(readSs());
  } readIs {
    return stoi(readSs());
  } return stoi(readSs()); stoi(readSs()) stoi readSs() readSs public static int stoi(String s){
    return Integer.parseInt(s);
  } stoi {
    return Integer.parseInt(s);
  } return Integer.parseInt(s); Integer.parseInt(s) Integer.parseInt Integer s String s s public static int[] stoi(String s[]){
    int a[]=new int[s.length];
    for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    }
    return a;
  } stoi {
    int a[]=new int[s.length];
    for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    }
    return a;
  } int a[]=new int[s.length]; a new int[s.length] s.length s s.length for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    } int i=0; int i=0; i 0 i<s.length i s.length s s.length i++ i++ i {
      a[i]=stoi(s[i]);
    } {
      a[i]=stoi(s[i]);
    } a[i]=stoi(s[i]) a[i] a i stoi(s[i]) stoi s[i] s i return a; a String s[] s public static String itos(int i){
    return String.valueOf(i);
  } itos {
    return String.valueOf(i);
  } return String.valueOf(i); String.valueOf(i) String.valueOf String i int i i public static String[] itos(int[] a){
    String s[]=new String[a.length];
    for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    }
    return s;
  } itos {
    String s[]=new String[a.length];
    for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    }
    return s;
  } String s[]=new String[a.length]; s new String[a.length] a.length a a.length for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    } int i=0; int i=0; i 0 i<a.length i a.length a a.length i++ i++ i {
      s[i]=itos(a[i]);
    } {
      s[i]=itos(a[i]);
    } s[i]=itos(a[i]) s[i] s i itos(a[i]) itos a[i] a i return s; s int[] a a public static String ctos(char c){
    return String.valueOf(c);
  } ctos {
    return String.valueOf(c);
  } return String.valueOf(c); String.valueOf(c) String.valueOf String c char c c public static String cstos(char[] c){
    return new String(c);
  } cstos {
    return new String(c);
  } return new String(c); new String(c) char[] c c public static char stoc(String s){
    return s.charAt(0);
  } stoc {
    return s.charAt(0);
  } return s.charAt(0); s.charAt(0) s.charAt s 0 String s s public static char[] stocs(String s){
    return s.toCharArray();
  } stocs {
    return s.toCharArray();
  } return s.toCharArray(); s.toCharArray() s.toCharArray s String s s
import java.util.*;
import java.io.*;
class Main{
  public static void main(String args[])throws IOException{
    char c1=readC(),c2=readC(),c3=readC();
    if(c1=='R'&&c2=='R'&&c3=='R'){
      pl("3");
    }else if((c1=='R'&&c2=='R')||(c3=='R'&&c2=='R')){
      pl("2");
    }else if(c1=='R'||c2=='R'||c3=='R'){
      pl("1");
    }else{
      pl("0");
    }
  }

  static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
  public static void pr(String str){
    System.out.print(str);
  }
  public static void pl(String str){
    System.out.println(str);
  }
  public static String read(){
    try{
      return ctos((char)br.read());
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static char readC(){
    try{
      return (char)br.read();
    }catch(IOException e){
      e.printStackTrace();
      return (char)-1;
    }
  }
  public static String readL(){
    try{
      return br.readLine();
    }catch(IOException e){
      e.printStackTrace();
      return "";
    }
  }
  public static String readS(){
    StringBuilder sb = new StringBuilder();
    while(true){
      try{
        int k = br.read();
        if(k==-1||(char)k==' '||(char)k=='\n'){break;}
        sb.append((char)k);
      }catch(IOException e){
        e.printStackTrace();
      }
    }
    return sb.toString();
  }
  public static int readI(){
    return stoi(readS());
  }
  public static long readLong(){
    return stol(readS());
  }
  public static long stol(String s){
    return Long.parseLong(s);
  }
  public static String[] readSs(){
    return readL().split(" ");
  }
  public static int[] readIs(){
    return stoi(readSs());
  }
  public static int stoi(String s){
    return Integer.parseInt(s);
  }
  public static int[] stoi(String s[]){
    int a[]=new int[s.length];
    for(int i=0;i<s.length;i++){
      a[i]=stoi(s[i]);
    }
    return a;
  }
  public static String itos(int i){
    return String.valueOf(i);
  }
  public static String[] itos(int[] a){
    String s[]=new String[a.length];
    for(int i=0;i<a.length;i++){
      s[i]=itos(a[i]);
    }
    return s;
  }
  public static String ctos(char c){
    return String.valueOf(c);
  }
  public static String cstos(char[] c){
    return new String(c);
  }
  public static char stoc(String s){
    return s.charAt(0);
  }
  public static char[] stocs(String s){
    return s.toCharArray();
  }
}
