import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		String s = in.next();
		int c = 1;
		for(int i = 0;i<3-1;i++) {
			char[] ch = s.toCharArray();
			
			 if(ch[i] =='S' && ch[i+1] == 'S') {
				c=0;
			}
			else if((ch[i]=='R' && ch[i+1] == 'R')){
				c++;
			}
			else if((ch[i] == 'S' && ch[i+1] == 'R')) {
				c=1;
			}
			 if(s.charAt(0) == 'R' && s.charAt(1) == 'S' && s.charAt(2)== 'S'){
				c=1;
			}
			
			
			
			
			
		}
		System.out.println(c);

	}

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

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		String s = in.next();
		int c = 1;
		for(int i = 0;i<3-1;i++) {
			char[] ch = s.toCharArray();
			
			 if(ch[i] =='S' && ch[i+1] == 'S') {
				c=0;
			}
			else if((ch[i]=='R' && ch[i+1] == 'R')){
				c++;
			}
			else if((ch[i] == 'S' && ch[i+1] == 'R')) {
				c=1;
			}
			 if(s.charAt(0) == 'R' && s.charAt(1) == 'S' && s.charAt(2)== 'S'){
				c=1;
			}
			
			
			
			
			
		}
		System.out.println(c);

	}

} Main public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		String s = in.next();
		int c = 1;
		for(int i = 0;i<3-1;i++) {
			char[] ch = s.toCharArray();
			
			 if(ch[i] =='S' && ch[i+1] == 'S') {
				c=0;
			}
			else if((ch[i]=='R' && ch[i+1] == 'R')){
				c++;
			}
			else if((ch[i] == 'S' && ch[i+1] == 'R')) {
				c=1;
			}
			 if(s.charAt(0) == 'R' && s.charAt(1) == 'S' && s.charAt(2)== 'S'){
				c=1;
			}
			
			
			
			
			
		}
		System.out.println(c);

	} main {
		
		Scanner in = new Scanner(System.in);
		
		String s = in.next();
		int c = 1;
		for(int i = 0;i<3-1;i++) {
			char[] ch = s.toCharArray();
			
			 if(ch[i] =='S' && ch[i+1] == 'S') {
				c=0;
			}
			else if((ch[i]=='R' && ch[i+1] == 'R')){
				c++;
			}
			else if((ch[i] == 'S' && ch[i+1] == 'R')) {
				c=1;
			}
			 if(s.charAt(0) == 'R' && s.charAt(1) == 'S' && s.charAt(2)== 'S'){
				c=1;
			}
			
			
			
			
			
		}
		System.out.println(c);

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

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		String s = in.next();
		int c = 1;
		for(int i = 0;i<3-1;i++) {
			char[] ch = s.toCharArray();
			
			 if(ch[i] =='S' && ch[i+1] == 'S') {
				c=0;
			}
			else if((ch[i]=='R' && ch[i+1] == 'R')){
				c++;
			}
			else if((ch[i] == 'S' && ch[i+1] == 'R')) {
				c=1;
			}
			 if(s.charAt(0) == 'R' && s.charAt(1) == 'S' && s.charAt(2)== 'S'){
				c=1;
			}
			
			
			
			
			
		}
		System.out.println(c);

	}

} public class Main {

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		String s = in.next();
		int c = 1;
		for(int i = 0;i<3-1;i++) {
			char[] ch = s.toCharArray();
			
			 if(ch[i] =='S' && ch[i+1] == 'S') {
				c=0;
			}
			else if((ch[i]=='R' && ch[i+1] == 'R')){
				c++;
			}
			else if((ch[i] == 'S' && ch[i+1] == 'R')) {
				c=1;
			}
			 if(s.charAt(0) == 'R' && s.charAt(1) == 'S' && s.charAt(2)== 'S'){
				c=1;
			}
			
			
			
			
			
		}
		System.out.println(c);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		String s = in.next();
		int c = 1;
		for(int i = 0;i<3-1;i++) {
			char[] ch = s.toCharArray();
			
			 if(ch[i] =='S' && ch[i+1] == 'S') {
				c=0;
			}
			else if((ch[i]=='R' && ch[i+1] == 'R')){
				c++;
			}
			else if((ch[i] == 'S' && ch[i+1] == 'R')) {
				c=1;
			}
			 if(s.charAt(0) == 'R' && s.charAt(1) == 'S' && s.charAt(2)== 'S'){
				c=1;
			}
			
			
			
			
			
		}
		System.out.println(c);

	}

}
