import java.util.Scanner;
public class Main {

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

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

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

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

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