import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char one = s.charAt(0);
		char two = s.charAt(1);
		char three = s.charAt(2);

		int count = 0;

		if (one == 'R')
			count++;
		if (two == 'R')
			count++;
		if (three == 'R')
			count++;

		if (count == 3) {
			print(3);
			return;
		}
		if (count == 2) {
			if (one == 'R' && three == 'R') {
				print(1);
				return;
			}
			print(2);
			return;
		}
		if (count == 1) {
			print(1);
			return;
		}
		print(0);
	}

	public static void print(Object obj) {
		System.out.println(obj);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char one = s.charAt(0);
		char two = s.charAt(1);
		char three = s.charAt(2);

		int count = 0;

		if (one == 'R')
			count++;
		if (two == 'R')
			count++;
		if (three == 'R')
			count++;

		if (count == 3) {
			print(3);
			return;
		}
		if (count == 2) {
			if (one == 'R' && three == 'R') {
				print(1);
				return;
			}
			print(2);
			return;
		}
		if (count == 1) {
			print(1);
			return;
		}
		print(0);
	}

	public static void print(Object obj) {
		System.out.println(obj);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char one = s.charAt(0);
		char two = s.charAt(1);
		char three = s.charAt(2);

		int count = 0;

		if (one == 'R')
			count++;
		if (two == 'R')
			count++;
		if (three == 'R')
			count++;

		if (count == 3) {
			print(3);
			return;
		}
		if (count == 2) {
			if (one == 'R' && three == 'R') {
				print(1);
				return;
			}
			print(2);
			return;
		}
		if (count == 1) {
			print(1);
			return;
		}
		print(0);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char one = s.charAt(0);
		char two = s.charAt(1);
		char three = s.charAt(2);

		int count = 0;

		if (one == 'R')
			count++;
		if (two == 'R')
			count++;
		if (three == 'R')
			count++;

		if (count == 3) {
			print(3);
			return;
		}
		if (count == 2) {
			if (one == 'R' && three == 'R') {
				print(1);
				return;
			}
			print(2);
			return;
		}
		if (count == 1) {
			print(1);
			return;
		}
		print(0);
	} 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 char one = s.charAt(0); one s.charAt(0) s.charAt s 0 char two = s.charAt(1); two s.charAt(1) s.charAt s 1 char three = s.charAt(2); three s.charAt(2) s.charAt s 2 int count = 0; count 0 if (one == 'R')
			count++; one == 'R' one 'R' count++ count if (two == 'R')
			count++; two == 'R' two 'R' count++ count if (three == 'R')
			count++; three == 'R' three 'R' count++ count if (count == 3) {
			print(3);
			return;
		} count == 3 count 3 {
			print(3);
			return;
		} print(3) print 3 return; if (count == 2) {
			if (one == 'R' && three == 'R') {
				print(1);
				return;
			}
			print(2);
			return;
		} count == 2 count 2 {
			if (one == 'R' && three == 'R') {
				print(1);
				return;
			}
			print(2);
			return;
		} if (one == 'R' && three == 'R') {
				print(1);
				return;
			} one == 'R' && three == 'R' one == 'R' one 'R' three == 'R' three 'R' {
				print(1);
				return;
			} print(1) print 1 return; print(2) print 2 return; if (count == 1) {
			print(1);
			return;
		} count == 1 count 1 {
			print(1);
			return;
		} print(1) print 1 return; print(0) print 0 String[] args args public static void print(Object obj) {
		System.out.println(obj);
	} print {
		System.out.println(obj);
	} System.out.println(obj) System.out.println System.out System System.out obj Object obj obj public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char one = s.charAt(0);
		char two = s.charAt(1);
		char three = s.charAt(2);

		int count = 0;

		if (one == 'R')
			count++;
		if (two == 'R')
			count++;
		if (three == 'R')
			count++;

		if (count == 3) {
			print(3);
			return;
		}
		if (count == 2) {
			if (one == 'R' && three == 'R') {
				print(1);
				return;
			}
			print(2);
			return;
		}
		if (count == 1) {
			print(1);
			return;
		}
		print(0);
	}

	public static void print(Object obj) {
		System.out.println(obj);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char one = s.charAt(0);
		char two = s.charAt(1);
		char three = s.charAt(2);

		int count = 0;

		if (one == 'R')
			count++;
		if (two == 'R')
			count++;
		if (three == 'R')
			count++;

		if (count == 3) {
			print(3);
			return;
		}
		if (count == 2) {
			if (one == 'R' && three == 'R') {
				print(1);
				return;
			}
			print(2);
			return;
		}
		if (count == 1) {
			print(1);
			return;
		}
		print(0);
	}

	public static void print(Object obj) {
		System.out.println(obj);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();

		char one = s.charAt(0);
		char two = s.charAt(1);
		char three = s.charAt(2);

		int count = 0;

		if (one == 'R')
			count++;
		if (two == 'R')
			count++;
		if (three == 'R')
			count++;

		if (count == 3) {
			print(3);
			return;
		}
		if (count == 2) {
			if (one == 'R' && three == 'R') {
				print(1);
				return;
			}
			print(2);
			return;
		}
		if (count == 1) {
			print(1);
			return;
		}
		print(0);
	}

	public static void print(Object obj) {
		System.out.println(obj);
	}
}