import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        
        switch (str){
            case "SSS":
                System.out.println("0");
                break;
            case "SSR":
                System.out.println("1");
                break;
            case "SRR":
                System.out.println("2");
                break;
            case "RRR":
                System.out.println("3");
                break;
            case "RRS":
                System.out.println("2");
                break;
            case "RSS":
                System.out.println("1");
                break;
            case "RSR":
                System.out.println("1");
                break;
            case "SRS":
                System.out.println("1");
                break;
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        
        switch (str){
            case "SSS":
                System.out.println("0");
                break;
            case "SSR":
                System.out.println("1");
                break;
            case "SRR":
                System.out.println("2");
                break;
            case "RRR":
                System.out.println("3");
                break;
            case "RRS":
                System.out.println("2");
                break;
            case "RSS":
                System.out.println("1");
                break;
            case "RSR":
                System.out.println("1");
                break;
            case "SRS":
                System.out.println("1");
                break;
        }
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        
        switch (str){
            case "SSS":
                System.out.println("0");
                break;
            case "SSR":
                System.out.println("1");
                break;
            case "SRR":
                System.out.println("2");
                break;
            case "RRR":
                System.out.println("3");
                break;
            case "RRS":
                System.out.println("2");
                break;
            case "RSS":
                System.out.println("1");
                break;
            case "RSR":
                System.out.println("1");
                break;
            case "SRS":
                System.out.println("1");
                break;
        }
    } main {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        
        switch (str){
            case "SSS":
                System.out.println("0");
                break;
            case "SSR":
                System.out.println("1");
                break;
            case "SRR":
                System.out.println("2");
                break;
            case "RRR":
                System.out.println("3");
                break;
            case "RRS":
                System.out.println("2");
                break;
            case "RSS":
                System.out.println("1");
                break;
            case "RSR":
                System.out.println("1");
                break;
            case "SRS":
                System.out.println("1");
                break;
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = scan.nextLine(); str scan.nextLine() scan.nextLine scan switch (str){
            case "SSS":
                System.out.println("0");
                break;
            case "SSR":
                System.out.println("1");
                break;
            case "SRR":
                System.out.println("2");
                break;
            case "RRR":
                System.out.println("3");
                break;
            case "RRS":
                System.out.println("2");
                break;
            case "RSS":
                System.out.println("1");
                break;
            case "RSR":
                System.out.println("1");
                break;
            case "SRS":
                System.out.println("1");
                break;
        } str case "SSS": "SSS" case "SSS": System.out.println("0") System.out.println System.out System System.out "0" break; case "SSR": "SSR" case "SSR": System.out.println("1") System.out.println System.out System System.out "1" break; case "SRR": "SRR" case "SRR": System.out.println("2") System.out.println System.out System System.out "2" break; case "RRR": "RRR" case "RRR": System.out.println("3") System.out.println System.out System System.out "3" break; case "RRS": "RRS" case "RRS": System.out.println("2") System.out.println System.out System System.out "2" break; case "RSS": "RSS" case "RSS": System.out.println("1") System.out.println System.out System System.out "1" break; case "RSR": "RSR" case "RSR": System.out.println("1") System.out.println System.out System System.out "1" break; case "SRS": "SRS" case "SRS": System.out.println("1") System.out.println System.out System System.out "1" break; String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        
        switch (str){
            case "SSS":
                System.out.println("0");
                break;
            case "SSR":
                System.out.println("1");
                break;
            case "SRR":
                System.out.println("2");
                break;
            case "RRR":
                System.out.println("3");
                break;
            case "RRS":
                System.out.println("2");
                break;
            case "RSS":
                System.out.println("1");
                break;
            case "RSR":
                System.out.println("1");
                break;
            case "SRS":
                System.out.println("1");
                break;
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        
        switch (str){
            case "SSS":
                System.out.println("0");
                break;
            case "SSR":
                System.out.println("1");
                break;
            case "SRR":
                System.out.println("2");
                break;
            case "RRR":
                System.out.println("3");
                break;
            case "RRS":
                System.out.println("2");
                break;
            case "RSS":
                System.out.println("1");
                break;
            case "RSR":
                System.out.println("1");
                break;
            case "SRS":
                System.out.println("1");
                break;
        }
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        
        switch (str){
            case "SSS":
                System.out.println("0");
                break;
            case "SSR":
                System.out.println("1");
                break;
            case "SRR":
                System.out.println("2");
                break;
            case "RRR":
                System.out.println("3");
                break;
            case "RRS":
                System.out.println("2");
                break;
            case "RSS":
                System.out.println("1");
                break;
            case "RSR":
                System.out.println("1");
                break;
            case "SRS":
                System.out.println("1");
                break;
        }
    }
}