import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Vector;

public class Main {

	public static void main(String[] args) {
		Scanner ob=new Scanner(System.in);

		String s1=ob.next();
		char s[]=s1.toCharArray();
		Vector v=new Vector();
		for (int i=0; i<s1.length();) {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		}
		if (v.isEmpty()) {
			System.out.println(0);
		}
		else {
			System.out.println(Collections.max(v));
		}
	}

} import java.util.Arrays; Arrays java.util import java.util.Collection; Collection java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.Vector; Vector java.util public class Main {

	public static void main(String[] args) {
		Scanner ob=new Scanner(System.in);

		String s1=ob.next();
		char s[]=s1.toCharArray();
		Vector v=new Vector();
		for (int i=0; i<s1.length();) {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		}
		if (v.isEmpty()) {
			System.out.println(0);
		}
		else {
			System.out.println(Collections.max(v));
		}
	}

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

		String s1=ob.next();
		char s[]=s1.toCharArray();
		Vector v=new Vector();
		for (int i=0; i<s1.length();) {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		}
		if (v.isEmpty()) {
			System.out.println(0);
		}
		else {
			System.out.println(Collections.max(v));
		}
	} main {
		Scanner ob=new Scanner(System.in);

		String s1=ob.next();
		char s[]=s1.toCharArray();
		Vector v=new Vector();
		for (int i=0; i<s1.length();) {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		}
		if (v.isEmpty()) {
			System.out.println(0);
		}
		else {
			System.out.println(Collections.max(v));
		}
	} Scanner ob=new Scanner(System.in); ob new Scanner(System.in) String s1=ob.next(); s1 ob.next() ob.next ob char s[]=s1.toCharArray(); s s1.toCharArray() s1.toCharArray s1 Vector v=new Vector(); v new Vector() for (int i=0; i<s1.length();) {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		} int i=0; int i=0; i 0 i<s1.length() i s1.length() s1.length s1 {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		} {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		} if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			} s1.charAt(i)=='R' s1.charAt(i) s1.charAt s1 i 'R' {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			} int count=0; count 0 while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				} i<s1.length()&&s1.charAt(i)=='R' i<s1.length() i s1.length() s1.length s1 s1.charAt(i)=='R' s1.charAt(i) s1.charAt s1 i 'R' {
					i++;
					count++;
				} i++ i count++ count v.add(count) v.add v count {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			} while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				} i<s1.length()&&s1.charAt(i)=='S' i<s1.length() i s1.length() s1.length s1 s1.charAt(i)=='S' s1.charAt(i) s1.charAt s1 i 'S' {
					i++;
				} i++ i if (v.isEmpty()) {
			System.out.println(0);
		}
		else {
			System.out.println(Collections.max(v));
		} v.isEmpty() v.isEmpty v {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 {
			System.out.println(Collections.max(v));
		} System.out.println(Collections.max(v)) System.out.println System.out System System.out Collections.max(v) Collections.max Collections v String[] args args public class Main {

	public static void main(String[] args) {
		Scanner ob=new Scanner(System.in);

		String s1=ob.next();
		char s[]=s1.toCharArray();
		Vector v=new Vector();
		for (int i=0; i<s1.length();) {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		}
		if (v.isEmpty()) {
			System.out.println(0);
		}
		else {
			System.out.println(Collections.max(v));
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner ob=new Scanner(System.in);

		String s1=ob.next();
		char s[]=s1.toCharArray();
		Vector v=new Vector();
		for (int i=0; i<s1.length();) {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		}
		if (v.isEmpty()) {
			System.out.println(0);
		}
		else {
			System.out.println(Collections.max(v));
		}
	}

} Main
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Vector;

public class Main {

	public static void main(String[] args) {
		Scanner ob=new Scanner(System.in);

		String s1=ob.next();
		char s[]=s1.toCharArray();
		Vector v=new Vector();
		for (int i=0; i<s1.length();) {
			if (s1.charAt(i)=='R') {
				int count=0;
				while (i<s1.length()&&s1.charAt(i)=='R') {
					i++;
					count++;
				}
				v.add(count);
			}
			else {
				while (i<s1.length()&&s1.charAt(i)=='S') {
					i++;
				}
			}
		}
		if (v.isEmpty()) {
			System.out.println(0);
		}
		else {
			System.out.println(Collections.max(v));
		}
	}

}
