import java.io.*;
import java.util.*;
import java.math.*;

/*
	Author:	Koushik Sahu
	Date: 28-Aug-2020 10:17:59 pm
*/

public class Main {

	static FastScanner fs = new FastScanner();

	public static void main(String[] args) {
		String s;
		s = fs.next();
		int ans = 0;
		int[] arr = new int[3];
		for(int i=0; i<3; i++) {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		}
		for(int i=1; i<3; i++) {
			if(arr[i]==1) arr[i] += arr[i-1];
		}
		ans = Math.max(arr[0], Math.max(arr[1], arr[2]));
		System.out.println(ans);
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		public String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

} import java.io.*; io.* java import java.util.*; util.* java import java.math.*; math.* java public class Main {

	static FastScanner fs = new FastScanner();

	public static void main(String[] args) {
		String s;
		s = fs.next();
		int ans = 0;
		int[] arr = new int[3];
		for(int i=0; i<3; i++) {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		}
		for(int i=1; i<3; i++) {
			if(arr[i]==1) arr[i] += arr[i-1];
		}
		ans = Math.max(arr[0], Math.max(arr[1], arr[2]));
		System.out.println(ans);
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		public String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

} Main static FastScanner fs = new FastScanner(); fs new FastScanner() public static void main(String[] args) {
		String s;
		s = fs.next();
		int ans = 0;
		int[] arr = new int[3];
		for(int i=0; i<3; i++) {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		}
		for(int i=1; i<3; i++) {
			if(arr[i]==1) arr[i] += arr[i-1];
		}
		ans = Math.max(arr[0], Math.max(arr[1], arr[2]));
		System.out.println(ans);
	} main {
		String s;
		s = fs.next();
		int ans = 0;
		int[] arr = new int[3];
		for(int i=0; i<3; i++) {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		}
		for(int i=1; i<3; i++) {
			if(arr[i]==1) arr[i] += arr[i-1];
		}
		ans = Math.max(arr[0], Math.max(arr[1], arr[2]));
		System.out.println(ans);
	} String s; s s = fs.next() s fs.next() fs.next fs int ans = 0; ans 0 int[] arr = new int[3]; arr new int[3] 3 for(int i=0; i<3; i++) {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		} {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		} if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0; s.charAt(i)=='R' s.charAt(i) s.charAt s i 'R' arr[i] = 1 arr[i] arr i 1 arr[i] = 0 arr[i] arr i 0 for(int i=1; i<3; i++) {
			if(arr[i]==1) arr[i] += arr[i-1];
		} int i=1; int i=1; i 1 i<3 i 3 i++ i++ i {
			if(arr[i]==1) arr[i] += arr[i-1];
		} {
			if(arr[i]==1) arr[i] += arr[i-1];
		} if(arr[i]==1) arr[i] += arr[i-1]; arr[i]==1 arr[i] arr i 1 arr[i] += arr[i-1] arr[i] arr i arr[i-1] arr i-1 i 1 ans = Math.max(arr[0], Math.max(arr[1], arr[2])) ans Math.max(arr[0], Math.max(arr[1], arr[2])) Math.max Math arr[0] arr 0 Math.max(arr[1], arr[2]) Math.max Math arr[1] arr 1 arr[2] arr 2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		public String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	} FastScanner BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st = new StringTokenizer(""); st new StringTokenizer("") public String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		} next {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		} while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				} !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				} IOException e {
					e.printStackTrace();
				} e.printStackTrace() e.printStackTrace e {
					st = new StringTokenizer(br.readLine());
				} st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		} nextLine {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		} String str = ""; str "" try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			} IOException e {
				e.printStackTrace();
			} e.printStackTrace() e.printStackTrace e {
				str = br.readLine();
			} str = br.readLine() str br.readLine() br.readLine br return str; str public int nextInt() {
			return Integer.parseInt(next());
		} nextInt {
			return Integer.parseInt(next());
		} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		} readArray {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		} int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++)
				a[i] = nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextInt(); a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public long nextLong() {
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		} readLongArray {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		} long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++)
				a[i] = nextLong(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextLong(); a[i] = nextLong() a[i] a i nextLong() nextLong return a; a int n n double nextDouble() {
			return Double.parseDouble(next());
		} nextDouble {
			return Double.parseDouble(next());
		} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public class Main {

	static FastScanner fs = new FastScanner();

	public static void main(String[] args) {
		String s;
		s = fs.next();
		int ans = 0;
		int[] arr = new int[3];
		for(int i=0; i<3; i++) {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		}
		for(int i=1; i<3; i++) {
			if(arr[i]==1) arr[i] += arr[i-1];
		}
		ans = Math.max(arr[0], Math.max(arr[1], arr[2]));
		System.out.println(ans);
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		public String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

} public class Main {

	static FastScanner fs = new FastScanner();

	public static void main(String[] args) {
		String s;
		s = fs.next();
		int ans = 0;
		int[] arr = new int[3];
		for(int i=0; i<3; i++) {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		}
		for(int i=1; i<3; i++) {
			if(arr[i]==1) arr[i] += arr[i-1];
		}
		ans = Math.max(arr[0], Math.max(arr[1], arr[2]));
		System.out.println(ans);
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		public String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

} Main
import java.io.*;
import java.util.*;
import java.math.*;

/*
	Author:	Koushik Sahu
	Date: 28-Aug-2020 10:17:59 pm
*/

public class Main {

	static FastScanner fs = new FastScanner();

	public static void main(String[] args) {
		String s;
		s = fs.next();
		int ans = 0;
		int[] arr = new int[3];
		for(int i=0; i<3; i++) {
			if(s.charAt(i)=='R') arr[i] = 1;
			else arr[i] = 0;
		}
		for(int i=1; i<3; i++) {
			if(arr[i]==1) arr[i] += arr[i-1];
		}
		ans = Math.max(arr[0], Math.max(arr[1], arr[2]));
		System.out.println(ans);
	}

	static class FastScanner {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		public String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

}