import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数取得
		String S = sc.next();
		sc.close();
		
		int answer = 0; 
		ArrayList<Character> charList = new ArrayList<>();
		
		for(int i = 0; i < S.length(); i++) {
			charList.add(S.charAt(i));
		}
		
		if(charList.get(0) == 'R') {
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			}
		}else {
			//最初がＳ
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			}
		}
		
		System.out.println(answer);
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数取得
		String S = sc.next();
		sc.close();
		
		int answer = 0; 
		ArrayList<Character> charList = new ArrayList<>();
		
		for(int i = 0; i < S.length(); i++) {
			charList.add(S.charAt(i));
		}
		
		if(charList.get(0) == 'R') {
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			}
		}else {
			//最初がＳ
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			}
		}
		
		System.out.println(answer);
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数取得
		String S = sc.next();
		sc.close();
		
		int answer = 0; 
		ArrayList<Character> charList = new ArrayList<>();
		
		for(int i = 0; i < S.length(); i++) {
			charList.add(S.charAt(i));
		}
		
		if(charList.get(0) == 'R') {
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			}
		}else {
			//最初がＳ
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			}
		}
		
		System.out.println(answer);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数取得
		String S = sc.next();
		sc.close();
		
		int answer = 0; 
		ArrayList<Character> charList = new ArrayList<>();
		
		for(int i = 0; i < S.length(); i++) {
			charList.add(S.charAt(i));
		}
		
		if(charList.get(0) == 'R') {
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			}
		}else {
			//最初がＳ
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			}
		}
		
		System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc sc.close() sc.close sc int answer = 0; answer 0 ArrayList<Character> charList = new ArrayList<>(); charList new ArrayList<>() for(int i = 0; i < S.length(); i++) {
			charList.add(S.charAt(i));
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			charList.add(S.charAt(i));
		} {
			charList.add(S.charAt(i));
		} charList.add(S.charAt(i)) charList.add charList S.charAt(i) S.charAt S i if(charList.get(0) == 'R') {
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			}
		}else {
			//最初がＳ
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			}
		} charList.get(0) == 'R' charList.get(0) charList.get charList 0 'R' {
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			}
		} if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			} charList.get(1) == 'R' charList.get(1) charList.get charList 1 'R' {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			} if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				} charList.get(2) == 'R' charList.get(2) charList.get charList 2 'R' {
					answer = 3;
				} answer = 3 answer 3 {
					answer = 2;
				} answer = 2 answer 2 {
				answer = 1;
			} answer = 1 answer 1 {
			//最初がＳ
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			}
		} if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			} charList.get(1) == 'R' charList.get(1) charList.get charList 1 'R' {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			} if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				} charList.get(2) == 'R' charList.get(2) charList.get charList 2 'R' {
					answer = 2;
				} answer = 2 answer 2 {
					answer = 1;
				} answer = 1 answer 1 {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			} if(charList.get(2) == 'R') {
					answer = 1;
				} charList.get(2) == 'R' charList.get(2) charList.get charList 2 'R' {
					answer = 1;
				} answer = 1 answer 1 System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数取得
		String S = sc.next();
		sc.close();
		
		int answer = 0; 
		ArrayList<Character> charList = new ArrayList<>();
		
		for(int i = 0; i < S.length(); i++) {
			charList.add(S.charAt(i));
		}
		
		if(charList.get(0) == 'R') {
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			}
		}else {
			//最初がＳ
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			}
		}
		
		System.out.println(answer);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数取得
		String S = sc.next();
		sc.close();
		
		int answer = 0; 
		ArrayList<Character> charList = new ArrayList<>();
		
		for(int i = 0; i < S.length(); i++) {
			charList.add(S.charAt(i));
		}
		
		if(charList.get(0) == 'R') {
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			}
		}else {
			//最初がＳ
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			}
		}
		
		System.out.println(answer);
	}

} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//数取得
		String S = sc.next();
		sc.close();
		
		int answer = 0; 
		ArrayList<Character> charList = new ArrayList<>();
		
		for(int i = 0; i < S.length(); i++) {
			charList.add(S.charAt(i));
		}
		
		if(charList.get(0) == 'R') {
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 3;
				}else {
					answer = 2;
				}
			}else {
				answer = 1;
			}
		}else {
			//最初がＳ
			if(charList.get(1) == 'R') {
				if(charList.get(2) == 'R') {
					answer = 2;
				}else {
					answer = 1;
				}
			}else {
				if(charList.get(2) == 'R') {
					answer = 1;
				}
			}
		}
		
		System.out.println(answer);
	}

}
