import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		//入力値取得
		char[] S = scan.next().toCharArray();


		//演算
		int result = 0;

		for (int i = 0; i < 3; i++) {
			if (S[i] == 'R') {
				result++;
			}
		}

		if (result == 2 && S[1] == 'S') {
			result = 1;
		}

		//結果出力
			System.out.println(result);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		//入力値取得
		char[] S = scan.next().toCharArray();


		//演算
		int result = 0;

		for (int i = 0; i < 3; i++) {
			if (S[i] == 'R') {
				result++;
			}
		}

		if (result == 2 && S[1] == 'S') {
			result = 1;
		}

		//結果出力
			System.out.println(result);
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		//入力値取得
		char[] S = scan.next().toCharArray();


		//演算
		int result = 0;

		for (int i = 0; i < 3; i++) {
			if (S[i] == 'R') {
				result++;
			}
		}

		if (result == 2 && S[1] == 'S') {
			result = 1;
		}

		//結果出力
			System.out.println(result);
	} main {

		Scanner scan = new Scanner(System.in);

		//入力値取得
		char[] S = scan.next().toCharArray();


		//演算
		int result = 0;

		for (int i = 0; i < 3; i++) {
			if (S[i] == 'R') {
				result++;
			}
		}

		if (result == 2 && S[1] == 'S') {
			result = 1;
		}

		//結果出力
			System.out.println(result);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) char[] S = scan.next().toCharArray(); S scan.next().toCharArray() scan.next().toCharArray scan.next() scan.next scan int result = 0; result 0 for (int i = 0; i < 3; i++) {
			if (S[i] == 'R') {
				result++;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if (S[i] == 'R') {
				result++;
			}
		} {
			if (S[i] == 'R') {
				result++;
			}
		} if (S[i] == 'R') {
				result++;
			} S[i] == 'R' S[i] S i 'R' {
				result++;
			} result++ result if (result == 2 && S[1] == 'S') {
			result = 1;
		} result == 2 && S[1] == 'S' result == 2 result 2 S[1] == 'S' S[1] S 1 'S' {
			result = 1;
		} result = 1 result 1 System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		//入力値取得
		char[] S = scan.next().toCharArray();


		//演算
		int result = 0;

		for (int i = 0; i < 3; i++) {
			if (S[i] == 'R') {
				result++;
			}
		}

		if (result == 2 && S[1] == 'S') {
			result = 1;
		}

		//結果出力
			System.out.println(result);
	}
} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		//入力値取得
		char[] S = scan.next().toCharArray();


		//演算
		int result = 0;

		for (int i = 0; i < 3; i++) {
			if (S[i] == 'R') {
				result++;
			}
		}

		if (result == 2 && S[1] == 'S') {
			result = 1;
		}

		//結果出力
			System.out.println(result);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		//入力値取得
		char[] S = scan.next().toCharArray();


		//演算
		int result = 0;

		for (int i = 0; i < 3; i++) {
			if (S[i] == 'R') {
				result++;
			}
		}

		if (result == 2 && S[1] == 'S') {
			result = 1;
		}

		//結果出力
			System.out.println(result);
	}
}
