import java.util.Scanner;

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

        if (a.equals("RRR"))
            count = 3;
        if (a.equals("RRS"))
            count = 2;
        if (a.equals("RSS"))
            count = 1;
        if (a.equals("SSS"))
            count = 0;
        if (a.equals("SSR"))
            count = 1;
        if (a.equals("SRR"))
            count = 2;
        if (a.equals("SRS"))
            count = 1;
        if (a.equals("RSR"))
            count = 1;

        System.out.println(count);

        s.close();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String a = s.nextLine();
        int count = 0;

        if (a.equals("RRR"))
            count = 3;
        if (a.equals("RRS"))
            count = 2;
        if (a.equals("RSS"))
            count = 1;
        if (a.equals("SSS"))
            count = 0;
        if (a.equals("SSR"))
            count = 1;
        if (a.equals("SRR"))
            count = 2;
        if (a.equals("SRS"))
            count = 1;
        if (a.equals("RSR"))
            count = 1;

        System.out.println(count);

        s.close();
    }
} Main public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String a = s.nextLine();
        int count = 0;

        if (a.equals("RRR"))
            count = 3;
        if (a.equals("RRS"))
            count = 2;
        if (a.equals("RSS"))
            count = 1;
        if (a.equals("SSS"))
            count = 0;
        if (a.equals("SSR"))
            count = 1;
        if (a.equals("SRR"))
            count = 2;
        if (a.equals("SRS"))
            count = 1;
        if (a.equals("RSR"))
            count = 1;

        System.out.println(count);

        s.close();
    } main {
        Scanner s = new Scanner(System.in);
        String a = s.nextLine();
        int count = 0;

        if (a.equals("RRR"))
            count = 3;
        if (a.equals("RRS"))
            count = 2;
        if (a.equals("RSS"))
            count = 1;
        if (a.equals("SSS"))
            count = 0;
        if (a.equals("SSR"))
            count = 1;
        if (a.equals("SRR"))
            count = 2;
        if (a.equals("SRS"))
            count = 1;
        if (a.equals("RSR"))
            count = 1;

        System.out.println(count);

        s.close();
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) String a = s.nextLine(); a s.nextLine() s.nextLine s int count = 0; count 0 if (a.equals("RRR"))
            count = 3; a.equals("RRR") a.equals a "RRR" count = 3 count 3 if (a.equals("RRS"))
            count = 2; a.equals("RRS") a.equals a "RRS" count = 2 count 2 if (a.equals("RSS"))
            count = 1; a.equals("RSS") a.equals a "RSS" count = 1 count 1 if (a.equals("SSS"))
            count = 0; a.equals("SSS") a.equals a "SSS" count = 0 count 0 if (a.equals("SSR"))
            count = 1; a.equals("SSR") a.equals a "SSR" count = 1 count 1 if (a.equals("SRR"))
            count = 2; a.equals("SRR") a.equals a "SRR" count = 2 count 2 if (a.equals("SRS"))
            count = 1; a.equals("SRS") a.equals a "SRS" count = 1 count 1 if (a.equals("RSR"))
            count = 1; a.equals("RSR") a.equals a "RSR" count = 1 count 1 System.out.println(count) System.out.println System.out System System.out count s.close() s.close s String[] args args public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String a = s.nextLine();
        int count = 0;

        if (a.equals("RRR"))
            count = 3;
        if (a.equals("RRS"))
            count = 2;
        if (a.equals("RSS"))
            count = 1;
        if (a.equals("SSS"))
            count = 0;
        if (a.equals("SSR"))
            count = 1;
        if (a.equals("SRR"))
            count = 2;
        if (a.equals("SRS"))
            count = 1;
        if (a.equals("RSR"))
            count = 1;

        System.out.println(count);

        s.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String a = s.nextLine();
        int count = 0;

        if (a.equals("RRR"))
            count = 3;
        if (a.equals("RRS"))
            count = 2;
        if (a.equals("RSS"))
            count = 1;
        if (a.equals("SSS"))
            count = 0;
        if (a.equals("SSR"))
            count = 1;
        if (a.equals("SRR"))
            count = 2;
        if (a.equals("SRS"))
            count = 1;
        if (a.equals("RSR"))
            count = 1;

        System.out.println(count);

        s.close();
    }
} Main
import java.util.Scanner;

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

        if (a.equals("RRR"))
            count = 3;
        if (a.equals("RRS"))
            count = 2;
        if (a.equals("RSS"))
            count = 1;
        if (a.equals("SSS"))
            count = 0;
        if (a.equals("SSR"))
            count = 1;
        if (a.equals("SRR"))
            count = 2;
        if (a.equals("SRS"))
            count = 1;
        if (a.equals("RSR"))
            count = 1;

        System.out.println(count);

        s.close();
    }
}