import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;



   public class Main
    {
  public static void main(String[] args) {
       
       Scanner sc = new Scanner(System.in);
       
       String str = sc.next();
       int rain = 0;
       char ch;
       
       if(str.equals("RRR")) 
        System.out.println(3);
        
        else if(str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR"))
        System.out.println(1);
        
        else if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0);
       
    }
    } import java.io.*; io.* java import java.math.*; math.* java import java.security.*; security.* java import java.text.*; text.* java import java.util.*; util.* java import java.util.concurrent.*; concurrent.* java.util import java.util.regex.*; regex.* java.util public class Main
    {
  public static void main(String[] args) {
       
       Scanner sc = new Scanner(System.in);
       
       String str = sc.next();
       int rain = 0;
       char ch;
       
       if(str.equals("RRR")) 
        System.out.println(3);
        
        else if(str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR"))
        System.out.println(1);
        
        else if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0);
       
    }
    } Main public static void main(String[] args) {
       
       Scanner sc = new Scanner(System.in);
       
       String str = sc.next();
       int rain = 0;
       char ch;
       
       if(str.equals("RRR")) 
        System.out.println(3);
        
        else if(str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR"))
        System.out.println(1);
        
        else if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0);
       
    } main {
       
       Scanner sc = new Scanner(System.in);
       
       String str = sc.next();
       int rain = 0;
       char ch;
       
       if(str.equals("RRR")) 
        System.out.println(3);
        
        else if(str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR"))
        System.out.println(1);
        
        else if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0);
       
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc int rain = 0; rain 0 char ch; ch if(str.equals("RRR")) 
        System.out.println(3);
        
        else if(str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR"))
        System.out.println(1);
        
        else if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0); str.equals("RRR") str.equals str "RRR" System.out.println(3) System.out.println System.out System System.out 3 if(str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR"))
        System.out.println(1);
        
        else if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0); str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR") str.equals("SRS") str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR") str.equals("RSS") str.equals str "RSS" str.equals("RSR") str.equals str "RSR" str.equals("SRS") str.equals str "SRS" str.equals("SSR") str.equals str "SSR" System.out.println(1) System.out.println System.out System System.out 1 if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0); str.equals("RRS") || str.equals("SRR") str.equals("RRS") str.equals str "RRS" str.equals("SRR") str.equals str "SRR" System.out.println(2) System.out.println System.out System System.out 2 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 sc = new Scanner(System.in);
       
       String str = sc.next();
       int rain = 0;
       char ch;
       
       if(str.equals("RRR")) 
        System.out.println(3);
        
        else if(str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR"))
        System.out.println(1);
        
        else if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0);
       
    }
    } public class Main
    {
  public static void main(String[] args) {
       
       Scanner sc = new Scanner(System.in);
       
       String str = sc.next();
       int rain = 0;
       char ch;
       
       if(str.equals("RRR")) 
        System.out.println(3);
        
        else if(str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR"))
        System.out.println(1);
        
        else if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0);
       
    }
    } Main
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;



   public class Main
    {
  public static void main(String[] args) {
       
       Scanner sc = new Scanner(System.in);
       
       String str = sc.next();
       int rain = 0;
       char ch;
       
       if(str.equals("RRR")) 
        System.out.println(3);
        
        else if(str.equals("RSS") || str.equals("RSR") || str.equals("SRS") || str.equals("SSR"))
        System.out.println(1);
        
        else if(str.equals("RRS") || str.equals("SRR"))
        System.out.println(2);
       
       else
       System.out.println(0);
       
    }
    }