import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		char[] cs = S.toCharArray();

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

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

		System.out.println(n);


	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		char[] cs = S.toCharArray();

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

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

		System.out.println(n);


	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		char[] cs = S.toCharArray();

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

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

		System.out.println(n);


	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		char[] cs = S.toCharArray();

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

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

		System.out.println(n);


	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc char[] cs = S.toCharArray(); cs S.toCharArray() S.toCharArray S int n = 0; n 0 for(int i=0; i<3; i++) {
			if(cs[i]=='R') {
				n++;
			}
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			if(cs[i]=='R') {
				n++;
			}
		} {
			if(cs[i]=='R') {
				n++;
			}
		} if(cs[i]=='R') {
				n++;
			} cs[i]=='R' cs[i] cs i 'R' {
				n++;
			} n++ n if(n==2 && cs[1]=='S') {
			n=1;
		} n==2 && cs[1]=='S' n==2 n 2 cs[1]=='S' cs[1] cs 1 'S' {
			n=1;
		} n=1 n 1 System.out.println(n) System.out.println System.out System System.out n String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		char[] cs = S.toCharArray();

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

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

		System.out.println(n);


	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		char[] cs = S.toCharArray();

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

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

		System.out.println(n);


	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		char[] cs = S.toCharArray();

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

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

		System.out.println(n);


	}

}
