import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Vector;

public class Main {

	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		String string = in.next();
		int max = 0;
		int submax = 0;
		for (int i = 0; i < string.length(); i++) {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		}
		if (max<submax) {
			System.out.println(submax);
		}else {
			System.out.println(max);
		}
		
	}

} import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet 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 in = new Scanner(System.in);
		String string = in.next();
		int max = 0;
		int submax = 0;
		for (int i = 0; i < string.length(); i++) {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		}
		if (max<submax) {
			System.out.println(submax);
		}else {
			System.out.println(max);
		}
		
	}

} Main public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		String string = in.next();
		int max = 0;
		int submax = 0;
		for (int i = 0; i < string.length(); i++) {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		}
		if (max<submax) {
			System.out.println(submax);
		}else {
			System.out.println(max);
		}
		
	} main {
		Scanner in = new Scanner(System.in);
		String string = in.next();
		int max = 0;
		int submax = 0;
		for (int i = 0; i < string.length(); i++) {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		}
		if (max<submax) {
			System.out.println(submax);
		}else {
			System.out.println(max);
		}
		
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) String string = in.next(); string in.next() in.next in int max = 0; max 0 int submax = 0; submax 0 for (int i = 0; i < string.length(); i++) {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		} int i = 0; int i = 0; i 0 i < string.length() i string.length() string.length string i++ i++ i {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		} {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		} if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			} string.charAt(i)=='R' string.charAt(i) string.charAt string i 'R' {
				submax++;
			} submax++ submax {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			} if (max<submax) {
					max = submax;
					submax = 0;
				} max<submax max submax {
					max = submax;
					submax = 0;
				} max = submax max submax submax = 0 submax 0 if (max<submax) {
			System.out.println(submax);
		}else {
			System.out.println(max);
		} max<submax max submax {
			System.out.println(submax);
		} System.out.println(submax) System.out.println System.out System System.out submax {
			System.out.println(max);
		} System.out.println(max) System.out.println System.out System System.out max String args[] args public class Main {

	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		String string = in.next();
		int max = 0;
		int submax = 0;
		for (int i = 0; i < string.length(); i++) {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		}
		if (max<submax) {
			System.out.println(submax);
		}else {
			System.out.println(max);
		}
		
	}

} public class Main {

	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		String string = in.next();
		int max = 0;
		int submax = 0;
		for (int i = 0; i < string.length(); i++) {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		}
		if (max<submax) {
			System.out.println(submax);
		}else {
			System.out.println(max);
		}
		
	}

} Main
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Vector;

public class Main {

	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		String string = in.next();
		int max = 0;
		int submax = 0;
		for (int i = 0; i < string.length(); i++) {
			if (string.charAt(i)=='R') {
				submax++;
			}else {
				if (max<submax) {
					max = submax;
					submax = 0;
				}
			}
		}
		if (max<submax) {
			System.out.println(submax);
		}else {
			System.out.println(max);
		}
		
	}

}