import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int count= 0;

		String s = scan.nextLine();

		for(int i = 0;i<s.length();i++) {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		}

		System.out.println(count);

		scan.close();


	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int count= 0;

		String s = scan.nextLine();

		for(int i = 0;i<s.length();i++) {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		}

		System.out.println(count);

		scan.close();


	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int count= 0;

		String s = scan.nextLine();

		for(int i = 0;i<s.length();i++) {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		}

		System.out.println(count);

		scan.close();


	} main {
		Scanner scan = new Scanner(System.in);
		int count= 0;

		String s = scan.nextLine();

		for(int i = 0;i<s.length();i++) {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		}

		System.out.println(count);

		scan.close();


	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int count= 0; count 0 String s = scan.nextLine(); s scan.nextLine() scan.nextLine scan for(int i = 0;i<s.length();i++) {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		} int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		} {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		} if(s.charAt(i) == 'R') {
				count++;
			} s.charAt(i) == 'R' s.charAt(i) s.charAt s i 'R' {
				count++;
			} count++ count if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			} s.charAt(1) == 'S' && s.charAt(0)=='R' s.charAt(1) == 'S' s.charAt(1) s.charAt s 1 'S' s.charAt(0)=='R' s.charAt(0) s.charAt s 0 'R' {
				count = 1;
			} count = 1 count 1 System.out.println(count) System.out.println System.out System System.out count scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int count= 0;

		String s = scan.nextLine();

		for(int i = 0;i<s.length();i++) {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		}

		System.out.println(count);

		scan.close();


	}

} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int count= 0;

		String s = scan.nextLine();

		for(int i = 0;i<s.length();i++) {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		}

		System.out.println(count);

		scan.close();


	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int count= 0;

		String s = scan.nextLine();

		for(int i = 0;i<s.length();i++) {
			if(s.charAt(i) == 'R') {
				count++;
			}
			if(s.charAt(1) == 'S' && s.charAt(0)=='R') {
				count = 1;
			}
		}

		System.out.println(count);

		scan.close();


	}

}
