import java.util.*;

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

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