import java.util.Scanner;

class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	
      	String str = sc.next();
      	String[] rs = new String[]{str.substring(0, 1), str.substring(1, 2), str.substring(2, 3)}; 
      	int count = 0;
      
      	if(rs[0].equals("R")) {
          	count++;
        }
      
        for(int i = 1; i <= rs.length - 1; i++) {
            if(rs[i].equals("R") && rs[i - 1].equals("R")) {
                count++;                
            }
            if(rs[i].equals("R") && rs[i - 1].equals("S")) {
                count = 1;
            }
         }
      
      	System.out.println(count);
      	sc.close();
    }
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	
      	String str = sc.next();
      	String[] rs = new String[]{str.substring(0, 1), str.substring(1, 2), str.substring(2, 3)}; 
      	int count = 0;
      
      	if(rs[0].equals("R")) {
          	count++;
        }
      
        for(int i = 1; i <= rs.length - 1; i++) {
            if(rs[i].equals("R") && rs[i - 1].equals("R")) {
                count++;                
            }
            if(rs[i].equals("R") && rs[i - 1].equals("S")) {
                count = 1;
            }
         }
      
      	System.out.println(count);
      	sc.close();
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	
      	String str = sc.next();
      	String[] rs = new String[]{str.substring(0, 1), str.substring(1, 2), str.substring(2, 3)}; 
      	int count = 0;
      
      	if(rs[0].equals("R")) {
          	count++;
        }
      
        for(int i = 1; i <= rs.length - 1; i++) {
            if(rs[i].equals("R") && rs[i - 1].equals("R")) {
                count++;                
            }
            if(rs[i].equals("R") && rs[i - 1].equals("S")) {
                count = 1;
            }
         }
      
      	System.out.println(count);
      	sc.close();
    } main {
    	Scanner sc = new Scanner(System.in);
      	
      	String str = sc.next();
      	String[] rs = new String[]{str.substring(0, 1), str.substring(1, 2), str.substring(2, 3)}; 
      	int count = 0;
      
      	if(rs[0].equals("R")) {
          	count++;
        }
      
        for(int i = 1; i <= rs.length - 1; i++) {
            if(rs[i].equals("R") && rs[i - 1].equals("R")) {
                count++;                
            }
            if(rs[i].equals("R") && rs[i - 1].equals("S")) {
                count = 1;
            }
         }
      
      	System.out.println(count);
      	sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc String[] rs = new String[]{str.substring(0, 1), str.substring(1, 2), str.substring(2, 3)}; rs new String[]{str.substring(0, 1), str.substring(1, 2), str.substring(2, 3)} int count = 0; count 0 if(rs[0].equals("R")) {
          	count++;
        } rs[0].equals("R") rs[0].equals rs[0] rs 0 "R" {
          	count++;
        } count++ count for(int i = 1; i <= rs.length - 1; i++) {
            if(rs[i].equals("R") && rs[i - 1].equals("R")) {
                count++;                
            }
            if(rs[i].equals("R") && rs[i - 1].equals("S")) {
                count = 1;
            }
         } int i = 1; int i = 1; i 1 i <= rs.length - 1 i rs.length - 1 rs.length rs rs.length 1 i++ i++ i {
            if(rs[i].equals("R") && rs[i - 1].equals("R")) {
                count++;                
            }
            if(rs[i].equals("R") && rs[i - 1].equals("S")) {
                count = 1;
            }
         } {
            if(rs[i].equals("R") && rs[i - 1].equals("R")) {
                count++;                
            }
            if(rs[i].equals("R") && rs[i - 1].equals("S")) {
                count = 1;
            }
         } if(rs[i].equals("R") && rs[i - 1].equals("R")) {
                count++;                
            } rs[i].equals("R") && rs[i - 1].equals("R") rs[i].equals("R") rs[i].equals rs[i] rs i "R" rs[i - 1].equals("R") rs[i - 1].equals rs[i - 1] rs i - 1 i 1 "R" {
                count++;                
            } count++ count if(rs[i].equals("R") && rs[i - 1].equals("S")) {
                count = 1;
            } rs[i].equals("R") && rs[i - 1].equals("S") rs[i].equals("R") rs[i].equals rs[i] rs i "R" rs[i - 1].equals("S") rs[i - 1].equals rs[i - 1] rs i - 1 i 1 "S" {
                count = 1;
            } count = 1 count 1 System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	
      	String str = sc.next();
      	String[] rs = new String[]{str.substring(0, 1), str.substring(1, 2), str.substring(2, 3)}; 
      	int count = 0;
      
      	if(rs[0].equals("R")) {
          	count++;
        }
      
        for(int i = 1; i <= rs.length - 1; i++) {
            if(rs[i].equals("R") && rs[i - 1].equals("R")) {
                count++;                
            }
            if(rs[i].equals("R") && rs[i - 1].equals("S")) {
                count = 1;
            }
         }
      
      	System.out.println(count);
      	sc.close();
    }
}