import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		String weather = sc.next();
		
		if(weather.equals("SSS")) {
			System.out.println(0);
			return;
		}
		
		if(weather.equals("RRR")) {
			System.out.println(3);
			return;
		}
		
		if(weather.equals("RRS")||weather.equals("SRR")) {
			System.out.println(2);
			return;
		}
		
		System.out.println(1);


		
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		String weather = sc.next();
		
		if(weather.equals("SSS")) {
			System.out.println(0);
			return;
		}
		
		if(weather.equals("RRR")) {
			System.out.println(3);
			return;
		}
		
		if(weather.equals("RRS")||weather.equals("SRR")) {
			System.out.println(2);
			return;
		}
		
		System.out.println(1);


		
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		String weather = sc.next();
		
		if(weather.equals("SSS")) {
			System.out.println(0);
			return;
		}
		
		if(weather.equals("RRR")) {
			System.out.println(3);
			return;
		}
		
		if(weather.equals("RRS")||weather.equals("SRR")) {
			System.out.println(2);
			return;
		}
		
		System.out.println(1);


		
	} main {

		Scanner sc = new Scanner(System.in);
		
		String weather = sc.next();
		
		if(weather.equals("SSS")) {
			System.out.println(0);
			return;
		}
		
		if(weather.equals("RRR")) {
			System.out.println(3);
			return;
		}
		
		if(weather.equals("RRS")||weather.equals("SRR")) {
			System.out.println(2);
			return;
		}
		
		System.out.println(1);


		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String weather = sc.next(); weather sc.next() sc.next sc if(weather.equals("SSS")) {
			System.out.println(0);
			return;
		} weather.equals("SSS") weather.equals weather "SSS" {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; if(weather.equals("RRR")) {
			System.out.println(3);
			return;
		} weather.equals("RRR") weather.equals weather "RRR" {
			System.out.println(3);
			return;
		} System.out.println(3) System.out.println System.out System System.out 3 return; if(weather.equals("RRS")||weather.equals("SRR")) {
			System.out.println(2);
			return;
		} weather.equals("RRS")||weather.equals("SRR") weather.equals("RRS") weather.equals weather "RRS" weather.equals("SRR") weather.equals weather "SRR" {
			System.out.println(2);
			return;
		} System.out.println(2) System.out.println System.out System System.out 2 return; 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) {

		Scanner sc = new Scanner(System.in);
		
		String weather = sc.next();
		
		if(weather.equals("SSS")) {
			System.out.println(0);
			return;
		}
		
		if(weather.equals("RRR")) {
			System.out.println(3);
			return;
		}
		
		if(weather.equals("RRS")||weather.equals("SRR")) {
			System.out.println(2);
			return;
		}
		
		System.out.println(1);


		
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		String weather = sc.next();
		
		if(weather.equals("SSS")) {
			System.out.println(0);
			return;
		}
		
		if(weather.equals("RRR")) {
			System.out.println(3);
			return;
		}
		
		if(weather.equals("RRS")||weather.equals("SRR")) {
			System.out.println(2);
			return;
		}
		
		System.out.println(1);


		
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		String weather = sc.next();
		
		if(weather.equals("SSS")) {
			System.out.println(0);
			return;
		}
		
		if(weather.equals("RRR")) {
			System.out.println(3);
			return;
		}
		
		if(weather.equals("RRS")||weather.equals("SRR")) {
			System.out.println(2);
			return;
		}
		
		System.out.println(1);


		
	}
}