import java.util.*;
import java.awt.Frame;
import java.io.*;

public class Main {
	// static ArrayList<Integer>[] g;

	static pair[] a;
	static int[][] memo;

	static int dp(int l, int r) {
		if (l > r)
			return 0;
		if (memo[l][r] != -1)
			return memo[l][r];
		int ans = dp(l + 1, r);
		ans = Math.max(ans, dp(l, r - 1));
		for (int idx : startAt[l]) {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}
		for (int idx : endAt[r]) {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}

		return memo[l][r] = ans;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
				char[] a=br.readLine().toCharArray();
				if(a[0]=='R' && a[1]=='R' && a[2]=='R')
					pw.println(3);
				else if((a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R'))
					pw.println(2);
				else if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0);

		pw.flush();
		pw.close();

	}

	static int maxSize;
	static boolean[][] exist;
	static ArrayList<Integer>[] startAt, endAt;

	static void compress(pair[] arr) {
		TreeSet<Integer> tr = new TreeSet<>();
		for (int i = 0; i < arr.length; i++) {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		}
		tr.add(0);
		tr.add((int) 1e9);
		HashMap<Integer, Integer> hm = new HashMap<>();
		for (int x : tr)
			hm.put(x, hm.size());
		for (int i = 0; i < arr.length; i++) {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		}
		maxSize = hm.size();
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		@Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			int x1 = y - x;
			int x2 = o.y - o.x;
			return x1 - x2;
		}

	}

} import java.util.*; util.* java import java.awt.Frame; Frame java.awt import java.io.*; io.* java public class Main {
	// static ArrayList<Integer>[] g;

	static pair[] a;
	static int[][] memo;

	static int dp(int l, int r) {
		if (l > r)
			return 0;
		if (memo[l][r] != -1)
			return memo[l][r];
		int ans = dp(l + 1, r);
		ans = Math.max(ans, dp(l, r - 1));
		for (int idx : startAt[l]) {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}
		for (int idx : endAt[r]) {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}

		return memo[l][r] = ans;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
				char[] a=br.readLine().toCharArray();
				if(a[0]=='R' && a[1]=='R' && a[2]=='R')
					pw.println(3);
				else if((a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R'))
					pw.println(2);
				else if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0);

		pw.flush();
		pw.close();

	}

	static int maxSize;
	static boolean[][] exist;
	static ArrayList<Integer>[] startAt, endAt;

	static void compress(pair[] arr) {
		TreeSet<Integer> tr = new TreeSet<>();
		for (int i = 0; i < arr.length; i++) {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		}
		tr.add(0);
		tr.add((int) 1e9);
		HashMap<Integer, Integer> hm = new HashMap<>();
		for (int x : tr)
			hm.put(x, hm.size());
		for (int i = 0; i < arr.length; i++) {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		}
		maxSize = hm.size();
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		@Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			int x1 = y - x;
			int x2 = o.y - o.x;
			return x1 - x2;
		}

	}

} Main static pair[] a; a static int[][] memo; memo static int maxSize; maxSize static boolean[][] exist; exist static ArrayList<Integer>[] startAt startAt endAt; endAt static int dp(int l, int r) {
		if (l > r)
			return 0;
		if (memo[l][r] != -1)
			return memo[l][r];
		int ans = dp(l + 1, r);
		ans = Math.max(ans, dp(l, r - 1));
		for (int idx : startAt[l]) {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}
		for (int idx : endAt[r]) {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}

		return memo[l][r] = ans;
	} dp {
		if (l > r)
			return 0;
		if (memo[l][r] != -1)
			return memo[l][r];
		int ans = dp(l + 1, r);
		ans = Math.max(ans, dp(l, r - 1));
		for (int idx : startAt[l]) {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}
		for (int idx : endAt[r]) {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}

		return memo[l][r] = ans;
	} if (l > r)
			return 0; l > r l r return 0; 0 if (memo[l][r] != -1)
			return memo[l][r]; memo[l][r] != -1 memo[l][r] memo[l] memo l r -1 1 return memo[l][r]; memo[l][r] memo[l] memo l r int ans = dp(l + 1, r); ans dp(l + 1, r) dp l + 1 l 1 r ans = Math.max(ans, dp(l, r - 1)) ans Math.max(ans, dp(l, r - 1)) Math.max Math ans dp(l, r - 1) dp l r - 1 r 1 for (int idx : startAt[l]) {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		} int idx startAt[l] startAt l {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		} {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		} if (a[idx].y >= r)
				continue; a[idx].y >= r a[idx].y a[idx] a idx a[idx].y r continue; int inc = exist[a[idx].y + 1][r] ? 1 : 0; inc exist[a[idx].y + 1][r] ? 1 : 0 exist[a[idx].y + 1][r] exist[a[idx].y + 1] exist a[idx].y + 1 a[idx].y a[idx] a idx a[idx].y 1 r 1 0 ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r)) ans Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r)) Math.max Math ans 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r) inc 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r) 1 dp(a[idx].x, a[idx].y) dp a[idx].x a[idx] a idx a[idx].x a[idx].y a[idx] a idx a[idx].y inc dp(a[idx].y + 1, r) dp a[idx].y + 1 a[idx].y a[idx] a idx a[idx].y 1 r for (int idx : endAt[r]) {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		} int idx endAt[r] endAt r {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		} {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		} if (a[idx].x <= l)
				continue; a[idx].x <= l a[idx].x a[idx] a idx a[idx].x l continue; int inc = exist[l][a[idx].x - 1] ? 1 : 0; inc exist[l][a[idx].x - 1] ? 1 : 0 exist[l][a[idx].x - 1] exist[l] exist l a[idx].x - 1 a[idx].x a[idx] a idx a[idx].x 1 1 0 ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r)) ans Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r)) Math.max Math ans 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r) inc 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r) 1 dp(a[idx].x, a[idx].y) dp a[idx].x a[idx] a idx a[idx].x a[idx].y a[idx] a idx a[idx].y inc dp(a[idx].y + 1, r) dp a[idx].y + 1 a[idx].y a[idx] a idx a[idx].y 1 r return memo[l][r] = ans; memo[l][r] = ans memo[l][r] memo[l] memo l r ans int l l int r r public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
				char[] a=br.readLine().toCharArray();
				if(a[0]=='R' && a[1]=='R' && a[2]=='R')
					pw.println(3);
				else if((a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R'))
					pw.println(2);
				else if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0);

		pw.flush();
		pw.close();

	} main {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
				char[] a=br.readLine().toCharArray();
				if(a[0]=='R' && a[1]=='R' && a[2]=='R')
					pw.println(3);
				else if((a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R'))
					pw.println(2);
				else if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0);

		pw.flush();
		pw.close();

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) char[] a=br.readLine().toCharArray(); a br.readLine().toCharArray() br.readLine().toCharArray br.readLine() br.readLine br if(a[0]=='R' && a[1]=='R' && a[2]=='R')
					pw.println(3);
				else if((a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R'))
					pw.println(2);
				else if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0); a[0]=='R' && a[1]=='R' && a[2]=='R' a[0]=='R' && a[1]=='R' && a[2]=='R' a[0]=='R' a[0] a 0 'R' a[1]=='R' a[1] a 1 'R' a[2]=='R' a[2] a 2 'R' pw.println(3) pw.println pw 3 if((a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R'))
					pw.println(2);
				else if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0); (a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R') (a[0]=='R' && a[1]=='R') a[0]=='R' a[0] a 0 'R' a[1]=='R' a[1] a 1 'R' (a[1]=='R' && a[2]=='R') a[1]=='R' a[1] a 1 'R' a[2]=='R' a[2] a 2 'R' pw.println(2) pw.println pw 2 if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0); a[0]=='R' || a[1]=='R'|| a[2]=='R' a[0]=='R' || a[1]=='R'|| a[2]=='R' a[0]=='R' a[0] a 0 'R' a[1]=='R' a[1] a 1 'R' a[2]=='R' a[2] a 2 'R' pw.println(1) pw.println pw 1 pw.println(0) pw.println pw 0 pw.flush() pw.flush pw pw.close() pw.close pw String[] args args static void compress(pair[] arr) {
		TreeSet<Integer> tr = new TreeSet<>();
		for (int i = 0; i < arr.length; i++) {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		}
		tr.add(0);
		tr.add((int) 1e9);
		HashMap<Integer, Integer> hm = new HashMap<>();
		for (int x : tr)
			hm.put(x, hm.size());
		for (int i = 0; i < arr.length; i++) {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		}
		maxSize = hm.size();
	} compress {
		TreeSet<Integer> tr = new TreeSet<>();
		for (int i = 0; i < arr.length; i++) {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		}
		tr.add(0);
		tr.add((int) 1e9);
		HashMap<Integer, Integer> hm = new HashMap<>();
		for (int x : tr)
			hm.put(x, hm.size());
		for (int i = 0; i < arr.length; i++) {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		}
		maxSize = hm.size();
	} TreeSet<Integer> tr = new TreeSet<>(); tr new TreeSet<>() for (int i = 0; i < arr.length; i++) {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		} {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		} tr.add(arr[i].x) tr.add tr arr[i].x arr[i] arr i arr[i].x tr.add(arr[i].y) tr.add tr arr[i].y arr[i] arr i arr[i].y tr.add(0) tr.add tr 0 tr.add((int) 1e9) tr.add tr (int) 1e9 HashMap<Integer, Integer> hm = new HashMap<>(); hm new HashMap<>() for (int x : tr)
			hm.put(x, hm.size()); int x tr hm.put(x, hm.size()); hm.put(x, hm.size()) hm.put hm x hm.size() hm.size hm for (int i = 0; i < arr.length; i++) {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		} {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		} arr[i].x = hm.get(arr[i].x) arr[i].x arr[i] arr i arr[i].x hm.get(arr[i].x) hm.get hm arr[i].x arr[i] arr i arr[i].x arr[i].y = hm.get(arr[i].y) arr[i].y arr[i] arr i arr[i].y hm.get(arr[i].y) hm.get hm arr[i].y arr[i] arr i arr[i].y maxSize = hm.size() maxSize hm.size() hm.size hm pair[] arr arr static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		@Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			int x1 = y - x;
			int x2 = o.y - o.x;
			return x1 - x2;
		}

	} pair int x; x int y; y public pair(int d, int u) {
			x = d;
			y = u;
		} pair {
			x = d;
			y = u;
		} x = d x d y = u y u int d d int u u @Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			int x1 = y - x;
			int x2 = o.y - o.x;
			return x1 - x2;
		} compareTo {
			// TODO Auto-generated method stub
			int x1 = y - x;
			int x2 = o.y - o.x;
			return x1 - x2;
		} int x1 = y - x; x1 y - x y x int x2 = o.y - o.x; x2 o.y - o.x o.y o o.y o.x o o.x return x1 - x2; x1 - x2 x1 x2 pair o o Comparable public class Main {
	// static ArrayList<Integer>[] g;

	static pair[] a;
	static int[][] memo;

	static int dp(int l, int r) {
		if (l > r)
			return 0;
		if (memo[l][r] != -1)
			return memo[l][r];
		int ans = dp(l + 1, r);
		ans = Math.max(ans, dp(l, r - 1));
		for (int idx : startAt[l]) {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}
		for (int idx : endAt[r]) {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}

		return memo[l][r] = ans;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
				char[] a=br.readLine().toCharArray();
				if(a[0]=='R' && a[1]=='R' && a[2]=='R')
					pw.println(3);
				else if((a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R'))
					pw.println(2);
				else if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0);

		pw.flush();
		pw.close();

	}

	static int maxSize;
	static boolean[][] exist;
	static ArrayList<Integer>[] startAt, endAt;

	static void compress(pair[] arr) {
		TreeSet<Integer> tr = new TreeSet<>();
		for (int i = 0; i < arr.length; i++) {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		}
		tr.add(0);
		tr.add((int) 1e9);
		HashMap<Integer, Integer> hm = new HashMap<>();
		for (int x : tr)
			hm.put(x, hm.size());
		for (int i = 0; i < arr.length; i++) {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		}
		maxSize = hm.size();
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		@Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			int x1 = y - x;
			int x2 = o.y - o.x;
			return x1 - x2;
		}

	}

} public class Main {
	// static ArrayList<Integer>[] g;

	static pair[] a;
	static int[][] memo;

	static int dp(int l, int r) {
		if (l > r)
			return 0;
		if (memo[l][r] != -1)
			return memo[l][r];
		int ans = dp(l + 1, r);
		ans = Math.max(ans, dp(l, r - 1));
		for (int idx : startAt[l]) {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}
		for (int idx : endAt[r]) {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}

		return memo[l][r] = ans;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
				char[] a=br.readLine().toCharArray();
				if(a[0]=='R' && a[1]=='R' && a[2]=='R')
					pw.println(3);
				else if((a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R'))
					pw.println(2);
				else if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0);

		pw.flush();
		pw.close();

	}

	static int maxSize;
	static boolean[][] exist;
	static ArrayList<Integer>[] startAt, endAt;

	static void compress(pair[] arr) {
		TreeSet<Integer> tr = new TreeSet<>();
		for (int i = 0; i < arr.length; i++) {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		}
		tr.add(0);
		tr.add((int) 1e9);
		HashMap<Integer, Integer> hm = new HashMap<>();
		for (int x : tr)
			hm.put(x, hm.size());
		for (int i = 0; i < arr.length; i++) {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		}
		maxSize = hm.size();
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		@Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			int x1 = y - x;
			int x2 = o.y - o.x;
			return x1 - x2;
		}

	}

} Main
import java.util.*;
import java.awt.Frame;
import java.io.*;

public class Main {
	// static ArrayList<Integer>[] g;

	static pair[] a;
	static int[][] memo;

	static int dp(int l, int r) {
		if (l > r)
			return 0;
		if (memo[l][r] != -1)
			return memo[l][r];
		int ans = dp(l + 1, r);
		ans = Math.max(ans, dp(l, r - 1));
		for (int idx : startAt[l]) {
			if (a[idx].y >= r)
				continue;
			int inc = exist[a[idx].y + 1][r] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}
		for (int idx : endAt[r]) {
			if (a[idx].x <= l)
				continue;
			int inc = exist[l][a[idx].x - 1] ? 1 : 0;
			ans = Math.max(ans, 1 + dp(a[idx].x, a[idx].y) + inc + dp(a[idx].y + 1, r));
		}

		return memo[l][r] = ans;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
				char[] a=br.readLine().toCharArray();
				if(a[0]=='R' && a[1]=='R' && a[2]=='R')
					pw.println(3);
				else if((a[0]=='R' && a[1]=='R')|| (a[1]=='R' && a[2]=='R'))
					pw.println(2);
				else if(a[0]=='R' || a[1]=='R'|| a[2]=='R')
					pw.println(1);
				else
					pw.println(0);

		pw.flush();
		pw.close();

	}

	static int maxSize;
	static boolean[][] exist;
	static ArrayList<Integer>[] startAt, endAt;

	static void compress(pair[] arr) {
		TreeSet<Integer> tr = new TreeSet<>();
		for (int i = 0; i < arr.length; i++) {
			tr.add(arr[i].x);
			tr.add(arr[i].y);
		}
		tr.add(0);
		tr.add((int) 1e9);
		HashMap<Integer, Integer> hm = new HashMap<>();
		for (int x : tr)
			hm.put(x, hm.size());
		for (int i = 0; i < arr.length; i++) {
			arr[i].x = hm.get(arr[i].x);
			arr[i].y = hm.get(arr[i].y);
		}
		maxSize = hm.size();
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		@Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			int x1 = y - x;
			int x2 = o.y - o.x;
			return x1 - x2;
		}

	}

}