import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);

        String str = s.next();
        int count = -1;
        
        String forStr;
        for(int i=str.length(); 0<=i; i--){
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        }
        System.out.println(count);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);

        String str = s.next();
        int count = -1;
        
        String forStr;
        for(int i=str.length(); 0<=i; i--){
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args){
        Scanner s = new Scanner(System.in);

        String str = s.next();
        int count = -1;
        
        String forStr;
        for(int i=str.length(); 0<=i; i--){
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        }
        System.out.println(count);
    } main {
        Scanner s = new Scanner(System.in);

        String str = s.next();
        int count = -1;
        
        String forStr;
        for(int i=str.length(); 0<=i; i--){
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        }
        System.out.println(count);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) String str = s.next(); str s.next() s.next s int count = -1; count -1 1 String forStr; forStr for(int i=str.length(); 0<=i; i--){
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        } int i=str.length(); int i=str.length(); i str.length() str.length str 0<=i 0 i i-- i-- i {
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        } {
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        } forStr = String.format(".*R{%d}.*", i) forStr String.format(".*R{%d}.*", i) String.format String ".*R{%d}.*" i if(str.matches(forStr)){
                count = i;
                i=-1;
            } str.matches(forStr) str.matches str forStr {
                count = i;
                i=-1;
            } count = i count i i=-1 i -1 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);

        String str = s.next();
        int count = -1;
        
        String forStr;
        for(int i=str.length(); 0<=i; i--){
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        }
        System.out.println(count);
    }
} public class Main{
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);

        String str = s.next();
        int count = -1;
        
        String forStr;
        for(int i=str.length(); 0<=i; i--){
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        }
        System.out.println(count);
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);

        String str = s.next();
        int count = -1;
        
        String forStr;
        for(int i=str.length(); 0<=i; i--){
            forStr = String.format(".*R{%d}.*", i);
            if(str.matches(forStr)){
                count = i;
                i=-1;
            }
        }
        System.out.println(count);
    }
}