import java.util.*;

public class Main{
	static public void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String str=sc.next();
		char ch1=str.charAt(0),ch2=str.charAt(1),ch3=str.charAt(2);
		
		if(ch1==ch2&&ch2==ch3&&ch1=='S'){
			System.out.println(0);
			return;
		}
		if(ch1==ch2&&ch2==ch3&&ch1=='R')System.out.println(3);
		else if(ch1=='R'){
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		}
		else if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1);
		sc.close();
		return;
	}
} import java.util.*; util.* java public class Main{
	static public void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String str=sc.next();
		char ch1=str.charAt(0),ch2=str.charAt(1),ch3=str.charAt(2);
		
		if(ch1==ch2&&ch2==ch3&&ch1=='S'){
			System.out.println(0);
			return;
		}
		if(ch1==ch2&&ch2==ch3&&ch1=='R')System.out.println(3);
		else if(ch1=='R'){
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		}
		else if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1);
		sc.close();
		return;
	}
} Main static public void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String str=sc.next();
		char ch1=str.charAt(0),ch2=str.charAt(1),ch3=str.charAt(2);
		
		if(ch1==ch2&&ch2==ch3&&ch1=='S'){
			System.out.println(0);
			return;
		}
		if(ch1==ch2&&ch2==ch3&&ch1=='R')System.out.println(3);
		else if(ch1=='R'){
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		}
		else if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1);
		sc.close();
		return;
	} main {
		Scanner sc=new Scanner(System.in);
		String str=sc.next();
		char ch1=str.charAt(0),ch2=str.charAt(1),ch3=str.charAt(2);
		
		if(ch1==ch2&&ch2==ch3&&ch1=='S'){
			System.out.println(0);
			return;
		}
		if(ch1==ch2&&ch2==ch3&&ch1=='R')System.out.println(3);
		else if(ch1=='R'){
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		}
		else if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1);
		sc.close();
		return;
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String str=sc.next(); str sc.next() sc.next sc char ch1=str.charAt(0) ch1 str.charAt(0) str.charAt str 0 ch2=str.charAt(1) ch2 str.charAt(1) str.charAt str 1 ch3=str.charAt(2); ch3 str.charAt(2) str.charAt str 2 if(ch1==ch2&&ch2==ch3&&ch1=='S'){
			System.out.println(0);
			return;
		} ch1==ch2&&ch2==ch3&&ch1=='S' ch1==ch2&&ch2==ch3&&ch1=='S' ch1==ch2 ch1 ch2 ch2==ch3 ch2 ch3 ch1=='S' ch1 'S' {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; if(ch1==ch2&&ch2==ch3&&ch1=='R')System.out.println(3);
		else if(ch1=='R'){
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		}
		else if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1); ch1==ch2&&ch2==ch3&&ch1=='R' ch1==ch2&&ch2==ch3&&ch1=='R' ch1==ch2 ch1 ch2 ch2==ch3 ch2 ch3 ch1=='R' ch1 'R' System.out.println(3) System.out.println System.out System System.out 3 if(ch1=='R'){
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		}
		else if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1); ch1=='R' ch1 'R' {
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		} if(ch1==ch2)System.out.println(2);
			else System.out.println(1); ch1==ch2 ch1 ch2 System.out.println(2) System.out.println System.out System System.out 2 System.out.println(1) System.out.println System.out System System.out 1 if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1); ch3=='R' ch3 'R' {
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		} if(ch2==ch3)System.out.println(2);
			else System.out.println(1); ch2==ch3 ch2 ch3 System.out.println(2) System.out.println System.out System System.out 2 System.out.println(1) System.out.println System.out System System.out 1 System.out.println(1) System.out.println System.out System System.out 1 sc.close() sc.close sc return; String[] args args public class Main{
	static public void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String str=sc.next();
		char ch1=str.charAt(0),ch2=str.charAt(1),ch3=str.charAt(2);
		
		if(ch1==ch2&&ch2==ch3&&ch1=='S'){
			System.out.println(0);
			return;
		}
		if(ch1==ch2&&ch2==ch3&&ch1=='R')System.out.println(3);
		else if(ch1=='R'){
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		}
		else if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1);
		sc.close();
		return;
	}
} public class Main{
	static public void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String str=sc.next();
		char ch1=str.charAt(0),ch2=str.charAt(1),ch3=str.charAt(2);
		
		if(ch1==ch2&&ch2==ch3&&ch1=='S'){
			System.out.println(0);
			return;
		}
		if(ch1==ch2&&ch2==ch3&&ch1=='R')System.out.println(3);
		else if(ch1=='R'){
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		}
		else if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1);
		sc.close();
		return;
	}
} Main
import java.util.*;

public class Main{
	static public void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String str=sc.next();
		char ch1=str.charAt(0),ch2=str.charAt(1),ch3=str.charAt(2);
		
		if(ch1==ch2&&ch2==ch3&&ch1=='S'){
			System.out.println(0);
			return;
		}
		if(ch1==ch2&&ch2==ch3&&ch1=='R')System.out.println(3);
		else if(ch1=='R'){
			if(ch1==ch2)System.out.println(2);
			else System.out.println(1);
		}
		else if(ch3=='R'){
			if(ch2==ch3)System.out.println(2);
			else System.out.println(1);
		}
		else System.out.println(1);
		sc.close();
		return;
	}
}