/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		String input = scanner.next();
		
		if(input.equals("SSS"))
			System.out.println(0);
			
		if(input.equals("RRR"))
			System.out.println(3);
			
		if(input.equals("RRS") || input.equals("SRR"))
			System.out.println(2);
			
		if(input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS"))
			System.out.println(1);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		String input = scanner.next();
		
		if(input.equals("SSS"))
			System.out.println(0);
			
		if(input.equals("RRR"))
			System.out.println(3);
			
		if(input.equals("RRS") || input.equals("SRR"))
			System.out.println(2);
			
		if(input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS"))
			System.out.println(1);
	}
} Main public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		String input = scanner.next();
		
		if(input.equals("SSS"))
			System.out.println(0);
			
		if(input.equals("RRR"))
			System.out.println(3);
			
		if(input.equals("RRS") || input.equals("SRR"))
			System.out.println(2);
			
		if(input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS"))
			System.out.println(1);
	} main {
		Scanner scanner = new Scanner(System.in);
		String input = scanner.next();
		
		if(input.equals("SSS"))
			System.out.println(0);
			
		if(input.equals("RRR"))
			System.out.println(3);
			
		if(input.equals("RRS") || input.equals("SRR"))
			System.out.println(2);
			
		if(input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS"))
			System.out.println(1);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String input = scanner.next(); input scanner.next() scanner.next scanner if(input.equals("SSS"))
			System.out.println(0); input.equals("SSS") input.equals input "SSS" System.out.println(0) System.out.println System.out System System.out 0 if(input.equals("RRR"))
			System.out.println(3); input.equals("RRR") input.equals input "RRR" System.out.println(3) System.out.println System.out System System.out 3 if(input.equals("RRS") || input.equals("SRR"))
			System.out.println(2); input.equals("RRS") || input.equals("SRR") input.equals("RRS") input.equals input "RRS" input.equals("SRR") input.equals input "SRR" System.out.println(2) System.out.println System.out System System.out 2 if(input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS"))
			System.out.println(1); input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS") input.equals("SSR") input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS") input.equals("RSR") input.equals input "RSR" input.equals("SRS") input.equals input "SRS" input.equals("SSR") input.equals input "SSR" input.equals("RSS") input.equals input "RSS" System.out.println(1) System.out.println System.out System System.out 1 String[] args args public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		String input = scanner.next();
		
		if(input.equals("SSS"))
			System.out.println(0);
			
		if(input.equals("RRR"))
			System.out.println(3);
			
		if(input.equals("RRS") || input.equals("SRR"))
			System.out.println(2);
			
		if(input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS"))
			System.out.println(1);
	}
} public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		String input = scanner.next();
		
		if(input.equals("SSS"))
			System.out.println(0);
			
		if(input.equals("RRR"))
			System.out.println(3);
			
		if(input.equals("RRS") || input.equals("SRR"))
			System.out.println(2);
			
		if(input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS"))
			System.out.println(1);
	}
} Main
/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scanner = new Scanner(System.in);
		String input = scanner.next();
		
		if(input.equals("SSS"))
			System.out.println(0);
			
		if(input.equals("RRR"))
			System.out.println(3);
			
		if(input.equals("RRS") || input.equals("SRR"))
			System.out.println(2);
			
		if(input.equals("RSR") || input.equals("SRS") || input.equals("SSR") || input.equals("RSS"))
			System.out.println(1);
	}
}