import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		String[] s = S.split("S");
		int ans = 0;
		for(int i = 0; i < s.length; i ++) {
			ans = Math.max(ans, s[i].length());
		}
		
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		String[] s = S.split("S");
		int ans = 0;
		for(int i = 0; i < s.length; i ++) {
			ans = Math.max(ans, s[i].length());
		}
		
		System.out.println(ans);
	}
} Main public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		String[] s = S.split("S");
		int ans = 0;
		for(int i = 0; i < s.length; i ++) {
			ans = Math.max(ans, s[i].length());
		}
		
		System.out.println(ans);
	} main {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		String[] s = S.split("S");
		int ans = 0;
		for(int i = 0; i < s.length; i ++) {
			ans = Math.max(ans, s[i].length());
		}
		
		System.out.println(ans);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) String S = stdIn.next(); S stdIn.next() stdIn.next stdIn String[] s = S.split("S"); s S.split("S") S.split S "S" int ans = 0; ans 0 for(int i = 0; i < s.length; i ++) {
			ans = Math.max(ans, s[i].length());
		} int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i ++ i ++ i {
			ans = Math.max(ans, s[i].length());
		} {
			ans = Math.max(ans, s[i].length());
		} ans = Math.max(ans, s[i].length()) ans Math.max(ans, s[i].length()) Math.max Math ans s[i].length() s[i].length s[i] s i System.out.println(ans) System.out.println System.out System System.out ans String args[] args public class Main {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		String[] s = S.split("S");
		int ans = 0;
		for(int i = 0; i < s.length; i ++) {
			ans = Math.max(ans, s[i].length());
		}
		
		System.out.println(ans);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		String[] s = S.split("S");
		int ans = 0;
		for(int i = 0; i < s.length; i ++) {
			ans = Math.max(ans, s[i].length());
		}
		
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner stdIn = new Scanner(System.in);
		String S = stdIn.next();
		String[] s = S.split("S");
		int ans = 0;
		for(int i = 0; i < s.length; i ++) {
			ans = Math.max(ans, s[i].length());
		}
		
		System.out.println(ans);
	}
}