import java.util.Scanner;
import java.time.Year;
import java.util.Random;
import java.math.*;

public class Main{
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        String a = sc.next();
        int R = 0;
        if(a.charAt(0)=='R'){
                R++;
        }
        if(a.charAt(1)=='R'){
                R=R+2;
        }
        if(a.charAt(2)=='R'){
            R = R+4;
        }
        
        if(R==1 || R==2|| R==4 || R==5){
            System.out.println(1);
        }else if(R==3 || R == 6){
            System.out.println(2);
        }else if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        }
    }
} import java.util.Scanner; Scanner java.util import java.time.Year; Year java.time import java.util.Random; Random java.util import java.math.*; math.* java public class Main{
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        String a = sc.next();
        int R = 0;
        if(a.charAt(0)=='R'){
                R++;
        }
        if(a.charAt(1)=='R'){
                R=R+2;
        }
        if(a.charAt(2)=='R'){
            R = R+4;
        }
        
        if(R==1 || R==2|| R==4 || R==5){
            System.out.println(1);
        }else if(R==3 || R == 6){
            System.out.println(2);
        }else if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        }
    }
} Main public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        String a = sc.next();
        int R = 0;
        if(a.charAt(0)=='R'){
                R++;
        }
        if(a.charAt(1)=='R'){
                R=R+2;
        }
        if(a.charAt(2)=='R'){
            R = R+4;
        }
        
        if(R==1 || R==2|| R==4 || R==5){
            System.out.println(1);
        }else if(R==3 || R == 6){
            System.out.println(2);
        }else if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        }
    } main {
        Scanner sc =new Scanner(System.in);
        String a = sc.next();
        int R = 0;
        if(a.charAt(0)=='R'){
                R++;
        }
        if(a.charAt(1)=='R'){
                R=R+2;
        }
        if(a.charAt(2)=='R'){
            R = R+4;
        }
        
        if(R==1 || R==2|| R==4 || R==5){
            System.out.println(1);
        }else if(R==3 || R == 6){
            System.out.println(2);
        }else if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        }
    } Scanner sc =new Scanner(System.in); sc new Scanner(System.in) String a = sc.next(); a sc.next() sc.next sc int R = 0; R 0 if(a.charAt(0)=='R'){
                R++;
        } a.charAt(0)=='R' a.charAt(0) a.charAt a 0 'R' {
                R++;
        } R++ R if(a.charAt(1)=='R'){
                R=R+2;
        } a.charAt(1)=='R' a.charAt(1) a.charAt a 1 'R' {
                R=R+2;
        } R=R+2 R R+2 R 2 if(a.charAt(2)=='R'){
            R = R+4;
        } a.charAt(2)=='R' a.charAt(2) a.charAt a 2 'R' {
            R = R+4;
        } R = R+4 R R+4 R 4 if(R==1 || R==2|| R==4 || R==5){
            System.out.println(1);
        }else if(R==3 || R == 6){
            System.out.println(2);
        }else if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        } R==1 || R==2|| R==4 || R==5 R==4 R==1 || R==2|| R==4 || R==5 R==1 R 1 R==2 R 2 R==4 R 4 R==5 R 5 {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 if(R==3 || R == 6){
            System.out.println(2);
        }else if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        } R==3 || R == 6 R==3 R 3 R == 6 R 6 {
            System.out.println(2);
        } System.out.println(2) System.out.println System.out System System.out 2 if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        } R==7 R 7 {
            System.out.println(3);
        } System.out.println(3) System.out.println System.out System System.out 3 {
            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 sc =new Scanner(System.in);
        String a = sc.next();
        int R = 0;
        if(a.charAt(0)=='R'){
                R++;
        }
        if(a.charAt(1)=='R'){
                R=R+2;
        }
        if(a.charAt(2)=='R'){
            R = R+4;
        }
        
        if(R==1 || R==2|| R==4 || R==5){
            System.out.println(1);
        }else if(R==3 || R == 6){
            System.out.println(2);
        }else if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        String a = sc.next();
        int R = 0;
        if(a.charAt(0)=='R'){
                R++;
        }
        if(a.charAt(1)=='R'){
                R=R+2;
        }
        if(a.charAt(2)=='R'){
            R = R+4;
        }
        
        if(R==1 || R==2|| R==4 || R==5){
            System.out.println(1);
        }else if(R==3 || R == 6){
            System.out.println(2);
        }else if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        }
    }
} Main
import java.util.Scanner;
import java.time.Year;
import java.util.Random;
import java.math.*;

public class Main{
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        String a = sc.next();
        int R = 0;
        if(a.charAt(0)=='R'){
                R++;
        }
        if(a.charAt(1)=='R'){
                R=R+2;
        }
        if(a.charAt(2)=='R'){
            R = R+4;
        }
        
        if(R==1 || R==2|| R==4 || R==5){
            System.out.println(1);
        }else if(R==3 || R == 6){
            System.out.println(2);
        }else if(R==7){
            System.out.println(3);
        }else{
            System.out.println(0);
        }
    }
}