import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(S.charAt(i) == 'R'){
				ans++;
			}
		}
		if(ans == 2 && S.charAt(1) == 'S'){
			ans--;
		}

		System.out.println(ans);

		stdIn.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(S.charAt(i) == 'R'){
				ans++;
			}
		}
		if(ans == 2 && S.charAt(1) == 'S'){
			ans--;
		}

		System.out.println(ans);

		stdIn.close();
	}
} Main public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(S.charAt(i) == 'R'){
				ans++;
			}
		}
		if(ans == 2 && S.charAt(1) == 'S'){
			ans--;
		}

		System.out.println(ans);

		stdIn.close();
	} main {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(S.charAt(i) == 'R'){
				ans++;
			}
		}
		if(ans == 2 && S.charAt(1) == 'S'){
			ans--;
		}

		System.out.println(ans);

		stdIn.close();
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) String S = stdIn.next(); S stdIn.next() stdIn.next stdIn int ans = 0; ans 0 for(int i = 0; i < 3; i++){
			if(S.charAt(i) == 'R'){
				ans++;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if(S.charAt(i) == 'R'){
				ans++;
			}
		} {
			if(S.charAt(i) == 'R'){
				ans++;
			}
		} if(S.charAt(i) == 'R'){
				ans++;
			} S.charAt(i) == 'R' S.charAt(i) S.charAt S i 'R' {
				ans++;
			} ans++ ans if(ans == 2 && S.charAt(1) == 'S'){
			ans--;
		} ans == 2 && S.charAt(1) == 'S' ans == 2 ans 2 S.charAt(1) == 'S' S.charAt(1) S.charAt S 1 'S' {
			ans--;
		} ans-- ans System.out.println(ans) System.out.println System.out System System.out ans stdIn.close() stdIn.close stdIn String[] args args public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(S.charAt(i) == 'R'){
				ans++;
			}
		}
		if(ans == 2 && S.charAt(1) == 'S'){
			ans--;
		}

		System.out.println(ans);

		stdIn.close();
	}
} public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(S.charAt(i) == 'R'){
				ans++;
			}
		}
		if(ans == 2 && S.charAt(1) == 'S'){
			ans--;
		}

		System.out.println(ans);

		stdIn.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		int ans = 0;
		for(int i = 0; i < 3; i++){
			if(S.charAt(i) == 'R'){
				ans++;
			}
		}
		if(ans == 2 && S.charAt(1) == 'S'){
			ans--;
		}

		System.out.println(ans);

		stdIn.close();
	}
}
