import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String wstrg = sc.next();
        int count = 0;
        if(wstrg.equals("SSS")) count = 0;
        if(wstrg.equals("SSR")) count = 1;
        if(wstrg.equals("SRS")) count = 1;
        if(wstrg.equals("RSS")) count = 1;
        if(wstrg.equals("RRS")) count = 2;
        if(wstrg.equals("SRR")) count = 2;
        if(wstrg.equals("RSR")) count = 1;
        if(wstrg.equals("RRR")) count = 3;
        System.out.println(count);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String wstrg = sc.next();
        int count = 0;
        if(wstrg.equals("SSS")) count = 0;
        if(wstrg.equals("SSR")) count = 1;
        if(wstrg.equals("SRS")) count = 1;
        if(wstrg.equals("RSS")) count = 1;
        if(wstrg.equals("RRS")) count = 2;
        if(wstrg.equals("SRR")) count = 2;
        if(wstrg.equals("RSR")) count = 1;
        if(wstrg.equals("RRR")) count = 3;
        System.out.println(count);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String wstrg = sc.next();
        int count = 0;
        if(wstrg.equals("SSS")) count = 0;
        if(wstrg.equals("SSR")) count = 1;
        if(wstrg.equals("SRS")) count = 1;
        if(wstrg.equals("RSS")) count = 1;
        if(wstrg.equals("RRS")) count = 2;
        if(wstrg.equals("SRR")) count = 2;
        if(wstrg.equals("RSR")) count = 1;
        if(wstrg.equals("RRR")) count = 3;
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        String wstrg = sc.next();
        int count = 0;
        if(wstrg.equals("SSS")) count = 0;
        if(wstrg.equals("SSR")) count = 1;
        if(wstrg.equals("SRS")) count = 1;
        if(wstrg.equals("RSS")) count = 1;
        if(wstrg.equals("RRS")) count = 2;
        if(wstrg.equals("SRR")) count = 2;
        if(wstrg.equals("RSR")) count = 1;
        if(wstrg.equals("RRR")) count = 3;
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String wstrg = sc.next(); wstrg sc.next() sc.next sc int count = 0; count 0 if(wstrg.equals("SSS")) count = 0; wstrg.equals("SSS") wstrg.equals wstrg "SSS" count = 0 count 0 if(wstrg.equals("SSR")) count = 1; wstrg.equals("SSR") wstrg.equals wstrg "SSR" count = 1 count 1 if(wstrg.equals("SRS")) count = 1; wstrg.equals("SRS") wstrg.equals wstrg "SRS" count = 1 count 1 if(wstrg.equals("RSS")) count = 1; wstrg.equals("RSS") wstrg.equals wstrg "RSS" count = 1 count 1 if(wstrg.equals("RRS")) count = 2; wstrg.equals("RRS") wstrg.equals wstrg "RRS" count = 2 count 2 if(wstrg.equals("SRR")) count = 2; wstrg.equals("SRR") wstrg.equals wstrg "SRR" count = 2 count 2 if(wstrg.equals("RSR")) count = 1; wstrg.equals("RSR") wstrg.equals wstrg "RSR" count = 1 count 1 if(wstrg.equals("RRR")) count = 3; wstrg.equals("RRR") wstrg.equals wstrg "RRR" count = 3 count 3 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 sc = new Scanner(System.in);
        String wstrg = sc.next();
        int count = 0;
        if(wstrg.equals("SSS")) count = 0;
        if(wstrg.equals("SSR")) count = 1;
        if(wstrg.equals("SRS")) count = 1;
        if(wstrg.equals("RSS")) count = 1;
        if(wstrg.equals("RRS")) count = 2;
        if(wstrg.equals("SRR")) count = 2;
        if(wstrg.equals("RSR")) count = 1;
        if(wstrg.equals("RRR")) count = 3;
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String wstrg = sc.next();
        int count = 0;
        if(wstrg.equals("SSS")) count = 0;
        if(wstrg.equals("SSR")) count = 1;
        if(wstrg.equals("SRS")) count = 1;
        if(wstrg.equals("RSS")) count = 1;
        if(wstrg.equals("RRS")) count = 2;
        if(wstrg.equals("SRR")) count = 2;
        if(wstrg.equals("RSR")) count = 1;
        if(wstrg.equals("RRR")) count = 3;
        System.out.println(count);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String wstrg = sc.next();
        int count = 0;
        if(wstrg.equals("SSS")) count = 0;
        if(wstrg.equals("SSR")) count = 1;
        if(wstrg.equals("SRS")) count = 1;
        if(wstrg.equals("RSS")) count = 1;
        if(wstrg.equals("RRS")) count = 2;
        if(wstrg.equals("SRR")) count = 2;
        if(wstrg.equals("RSR")) count = 1;
        if(wstrg.equals("RRR")) count = 3;
        System.out.println(count);
    }
}