import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		char[] s_one = s.toCharArray();
		boolean chain = true;
		int count = 0;

		if(s.equals("RRR")) {
			count = 3;
		}else if(s.equals("RRS") || s.equals("SRR")){
			count = 2;
		}else if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		}

		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		char[] s_one = s.toCharArray();
		boolean chain = true;
		int count = 0;

		if(s.equals("RRR")) {
			count = 3;
		}else if(s.equals("RRS") || s.equals("SRR")){
			count = 2;
		}else if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		}

		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		char[] s_one = s.toCharArray();
		boolean chain = true;
		int count = 0;

		if(s.equals("RRR")) {
			count = 3;
		}else if(s.equals("RRS") || s.equals("SRR")){
			count = 2;
		}else if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		}

		System.out.println(count);
	} main {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		char[] s_one = s.toCharArray();
		boolean chain = true;
		int count = 0;

		if(s.equals("RRR")) {
			count = 3;
		}else if(s.equals("RRS") || s.equals("SRR")){
			count = 2;
		}else if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		}

		System.out.println(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan char[] s_one = s.toCharArray(); s_one s.toCharArray() s.toCharArray s boolean chain = true; chain true int count = 0; count 0 if(s.equals("RRR")) {
			count = 3;
		}else if(s.equals("RRS") || s.equals("SRR")){
			count = 2;
		}else if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		} s.equals("RRR") s.equals s "RRR" {
			count = 3;
		} count = 3 count 3 if(s.equals("RRS") || s.equals("SRR")){
			count = 2;
		}else if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		} s.equals("RRS") || s.equals("SRR") s.equals("RRS") s.equals s "RRS" s.equals("SRR") s.equals s "SRR" {
			count = 2;
		} count = 2 count 2 if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		} s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS") s.equals("SSR") s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS") s.equals("RSS") s.equals s "RSS" s.equals("RSR") s.equals s "RSR" s.equals("SSR") s.equals s "SSR" s.equals("SRS") s.equals s "SRS" {
			count = 1;
		} count = 1 count 1 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 scan = new Scanner(System.in);
		String s = scan.next();
		char[] s_one = s.toCharArray();
		boolean chain = true;
		int count = 0;

		if(s.equals("RRR")) {
			count = 3;
		}else if(s.equals("RRS") || s.equals("SRR")){
			count = 2;
		}else if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		}

		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		char[] s_one = s.toCharArray();
		boolean chain = true;
		int count = 0;

		if(s.equals("RRR")) {
			count = 3;
		}else if(s.equals("RRS") || s.equals("SRR")){
			count = 2;
		}else if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		}

		System.out.println(count);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		char[] s_one = s.toCharArray();
		boolean chain = true;
		int count = 0;

		if(s.equals("RRR")) {
			count = 3;
		}else if(s.equals("RRS") || s.equals("SRR")){
			count = 2;
		}else if(s.equals("RSS") || s.equals("RSR") || s.equals("SSR") || s.equals("SRS")) {
			count = 1;
		}

		System.out.println(count);
	}
}
