import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		String b = scan.next();
		char c[] = b.toCharArray();

		scan.close();

		int count = 0;

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

		if(count==3) {
			System.out.println("3");
		}else if(count==1) {
			System.out.println("1");
		}else if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		}
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		String b = scan.next();
		char c[] = b.toCharArray();

		scan.close();

		int count = 0;

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

		if(count==3) {
			System.out.println("3");
		}else if(count==1) {
			System.out.println("1");
		}else if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		}
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		String b = scan.next();
		char c[] = b.toCharArray();

		scan.close();

		int count = 0;

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

		if(count==3) {
			System.out.println("3");
		}else if(count==1) {
			System.out.println("1");
		}else if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		}
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		String b = scan.next();
		char c[] = b.toCharArray();

		scan.close();

		int count = 0;

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

		if(count==3) {
			System.out.println("3");
		}else if(count==1) {
			System.out.println("1");
		}else if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String b = scan.next(); b scan.next() scan.next scan char c[] = b.toCharArray(); c b.toCharArray() b.toCharArray b scan.close() scan.close scan int count = 0; count 0 for(int i=0;i<3;i++) {
			if(c[i]=='R') {
				count++;
			}
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			if(c[i]=='R') {
				count++;
			}
		} {
			if(c[i]=='R') {
				count++;
			}
		} if(c[i]=='R') {
				count++;
			} c[i]=='R' c[i] c i 'R' {
				count++;
			} count++ count if(count==3) {
			System.out.println("3");
		}else if(count==1) {
			System.out.println("1");
		}else if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		} count==3 count 3 {
			System.out.println("3");
		} System.out.println("3") System.out.println System.out System System.out "3" if(count==1) {
			System.out.println("1");
		}else if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		} count==1 count 1 {
			System.out.println("1");
		} System.out.println("1") System.out.println System.out System System.out "1" if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		} count==2 count 2 {
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		} if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			} c[1]=='S' c[1] c 1 'S' {
				System.out.println("1");
			} System.out.println("1") System.out.println System.out System System.out "1" {
				System.out.println("2");
			} System.out.println("2") System.out.println System.out System System.out "2" {
			System.out.println("0");
		} System.out.println("0") System.out.println System.out System System.out "0" String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		String b = scan.next();
		char c[] = b.toCharArray();

		scan.close();

		int count = 0;

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

		if(count==3) {
			System.out.println("3");
		}else if(count==1) {
			System.out.println("1");
		}else if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		}
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		String b = scan.next();
		char c[] = b.toCharArray();

		scan.close();

		int count = 0;

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

		if(count==3) {
			System.out.println("3");
		}else if(count==1) {
			System.out.println("1");
		}else if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		}
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		String b = scan.next();
		char c[] = b.toCharArray();

		scan.close();

		int count = 0;

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

		if(count==3) {
			System.out.println("3");
		}else if(count==1) {
			System.out.println("1");
		}else if(count==2){
			if(c[1]=='S') {
				System.out.println("1");
			}else {
				System.out.println("2");
			}
		}else {
			System.out.println("0");
		}
	}

}
