import java.util.*;
public class Main {
    public void solve() {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        if (S.equals("SSS")) System.out.println(0);
        if (S.equals("SSR")) System.out.println(1);
        if (S.equals("SRS")) System.out.println(1);
        if (S.equals("RSS")) System.out.println(1);
        if (S.equals("RRS")) System.out.println(2);
        if (S.equals("RSR")) System.out.println(1);
        if (S.equals("SRR")) System.out.println(2);
        if (S.equals("RRR")) System.out.println(3);

    }

    public static void main(String[] args) {
        new Main().solve();
    }
} import java.util.*; util.* java public class Main {
    public void solve() {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        if (S.equals("SSS")) System.out.println(0);
        if (S.equals("SSR")) System.out.println(1);
        if (S.equals("SRS")) System.out.println(1);
        if (S.equals("RSS")) System.out.println(1);
        if (S.equals("RRS")) System.out.println(2);
        if (S.equals("RSR")) System.out.println(1);
        if (S.equals("SRR")) System.out.println(2);
        if (S.equals("RRR")) System.out.println(3);

    }

    public static void main(String[] args) {
        new Main().solve();
    }
} Main public void solve() {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        if (S.equals("SSS")) System.out.println(0);
        if (S.equals("SSR")) System.out.println(1);
        if (S.equals("SRS")) System.out.println(1);
        if (S.equals("RSS")) System.out.println(1);
        if (S.equals("RRS")) System.out.println(2);
        if (S.equals("RSR")) System.out.println(1);
        if (S.equals("SRR")) System.out.println(2);
        if (S.equals("RRR")) System.out.println(3);

    } solve {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        if (S.equals("SSS")) System.out.println(0);
        if (S.equals("SSR")) System.out.println(1);
        if (S.equals("SRS")) System.out.println(1);
        if (S.equals("RSS")) System.out.println(1);
        if (S.equals("RRS")) System.out.println(2);
        if (S.equals("RSR")) System.out.println(1);
        if (S.equals("SRR")) System.out.println(2);
        if (S.equals("RRR")) System.out.println(3);

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String S = scan.next(); S scan.next() scan.next scan if (S.equals("SSS")) System.out.println(0); S.equals("SSS") S.equals S "SSS" System.out.println(0) System.out.println System.out System System.out 0 if (S.equals("SSR")) System.out.println(1); S.equals("SSR") S.equals S "SSR" System.out.println(1) System.out.println System.out System System.out 1 if (S.equals("SRS")) System.out.println(1); S.equals("SRS") S.equals S "SRS" System.out.println(1) System.out.println System.out System System.out 1 if (S.equals("RSS")) System.out.println(1); S.equals("RSS") S.equals S "RSS" System.out.println(1) System.out.println System.out System System.out 1 if (S.equals("RRS")) System.out.println(2); S.equals("RRS") S.equals S "RRS" System.out.println(2) System.out.println System.out System System.out 2 if (S.equals("RSR")) System.out.println(1); S.equals("RSR") S.equals S "RSR" System.out.println(1) System.out.println System.out System System.out 1 if (S.equals("SRR")) System.out.println(2); S.equals("SRR") S.equals S "SRR" System.out.println(2) System.out.println System.out System System.out 2 if (S.equals("RRR")) System.out.println(3); S.equals("RRR") S.equals S "RRR" System.out.println(3) System.out.println System.out System System.out 3 public static void main(String[] args) {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args public class Main {
    public void solve() {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        if (S.equals("SSS")) System.out.println(0);
        if (S.equals("SSR")) System.out.println(1);
        if (S.equals("SRS")) System.out.println(1);
        if (S.equals("RSS")) System.out.println(1);
        if (S.equals("RRS")) System.out.println(2);
        if (S.equals("RSR")) System.out.println(1);
        if (S.equals("SRR")) System.out.println(2);
        if (S.equals("RRR")) System.out.println(3);

    }

    public static void main(String[] args) {
        new Main().solve();
    }
} public class Main {
    public void solve() {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        if (S.equals("SSS")) System.out.println(0);
        if (S.equals("SSR")) System.out.println(1);
        if (S.equals("SRS")) System.out.println(1);
        if (S.equals("RSS")) System.out.println(1);
        if (S.equals("RRS")) System.out.println(2);
        if (S.equals("RSR")) System.out.println(1);
        if (S.equals("SRR")) System.out.println(2);
        if (S.equals("RRR")) System.out.println(3);

    }

    public static void main(String[] args) {
        new Main().solve();
    }
} Main
import java.util.*;
public class Main {
    public void solve() {
        Scanner scan = new Scanner(System.in);
        String S = scan.next();
        if (S.equals("SSS")) System.out.println(0);
        if (S.equals("SSR")) System.out.println(1);
        if (S.equals("SRS")) System.out.println(1);
        if (S.equals("RSS")) System.out.println(1);
        if (S.equals("RRS")) System.out.println(2);
        if (S.equals("RSR")) System.out.println(1);
        if (S.equals("SRR")) System.out.println(2);
        if (S.equals("RRR")) System.out.println(3);

    }

    public static void main(String[] args) {
        new Main().solve();
    }
}