import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
	Scanner sc = new Scanner (System.in);
	ArrayList<String> slist = new ArrayList<>();

	String s = sc.next();
	boolean three = false;
	int count = 0;
	int max = 0;

	if(s.equals("RRR")) {
		max = 3;
	}else {
		for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		}
	}
	if(three == true) {
		System.out.println("3");
	}else if(count > max) {
		System.out.println(count);
	}else {
		System.out.println(max);
	}

}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
public static void main(String[] args) {
	Scanner sc = new Scanner (System.in);
	ArrayList<String> slist = new ArrayList<>();

	String s = sc.next();
	boolean three = false;
	int count = 0;
	int max = 0;

	if(s.equals("RRR")) {
		max = 3;
	}else {
		for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		}
	}
	if(three == true) {
		System.out.println("3");
	}else if(count > max) {
		System.out.println(count);
	}else {
		System.out.println(max);
	}

}
} Main public static void main(String[] args) {
	Scanner sc = new Scanner (System.in);
	ArrayList<String> slist = new ArrayList<>();

	String s = sc.next();
	boolean three = false;
	int count = 0;
	int max = 0;

	if(s.equals("RRR")) {
		max = 3;
	}else {
		for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		}
	}
	if(three == true) {
		System.out.println("3");
	}else if(count > max) {
		System.out.println(count);
	}else {
		System.out.println(max);
	}

} main {
	Scanner sc = new Scanner (System.in);
	ArrayList<String> slist = new ArrayList<>();

	String s = sc.next();
	boolean three = false;
	int count = 0;
	int max = 0;

	if(s.equals("RRR")) {
		max = 3;
	}else {
		for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		}
	}
	if(three == true) {
		System.out.println("3");
	}else if(count > max) {
		System.out.println(count);
	}else {
		System.out.println(max);
	}

} Scanner sc = new Scanner (System.in); sc new Scanner (System.in) ArrayList<String> slist = new ArrayList<>(); slist new ArrayList<>() String s = sc.next(); s sc.next() sc.next sc boolean three = false; three false int count = 0; count 0 int max = 0; max 0 if(s.equals("RRR")) {
		max = 3;
	}else {
		for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		}
	} s.equals("RRR") s.equals s "RRR" {
		max = 3;
	} max = 3 max 3 {
		for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		}
	} for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			slist.add(s.substring(i, i+1));
		} {
			slist.add(s.substring(i, i+1));
		} slist.add(s.substring(i, i+1)) slist.add slist s.substring(i, i+1) s.substring s i i+1 i 1 for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		} {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		} if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			} slist.get(i).equals("R") slist.get(i).equals slist.get(i) slist.get slist i "R" {
				three = true;
			} three = true three true {
				three = false;
				break;
			} three = false three false break; for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		} {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		} if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			} slist.get(i).equals("R") slist.get(i).equals slist.get(i) slist.get slist i "R" {
				count++;
			} count++ count if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			} slist.get(i).equals("S") slist.get(i).equals slist.get(i) slist.get slist i "S" {
				if(max < count) {
					max = count;
					count = 0;
				}
			} if(max < count) {
					max = count;
					count = 0;
				} max < count max count {
					max = count;
					count = 0;
				} max = count max count count = 0 count 0 if(three == true) {
		System.out.println("3");
	}else if(count > max) {
		System.out.println(count);
	}else {
		System.out.println(max);
	} three == true three true {
		System.out.println("3");
	} System.out.println("3") System.out.println System.out System System.out "3" if(count > max) {
		System.out.println(count);
	}else {
		System.out.println(max);
	} count > max count max {
		System.out.println(count);
	} System.out.println(count) System.out.println System.out System System.out count {
		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 sc = new Scanner (System.in);
	ArrayList<String> slist = new ArrayList<>();

	String s = sc.next();
	boolean three = false;
	int count = 0;
	int max = 0;

	if(s.equals("RRR")) {
		max = 3;
	}else {
		for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		}
	}
	if(three == true) {
		System.out.println("3");
	}else if(count > max) {
		System.out.println(count);
	}else {
		System.out.println(max);
	}

}
} public class Main {
public static void main(String[] args) {
	Scanner sc = new Scanner (System.in);
	ArrayList<String> slist = new ArrayList<>();

	String s = sc.next();
	boolean three = false;
	int count = 0;
	int max = 0;

	if(s.equals("RRR")) {
		max = 3;
	}else {
		for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		}
	}
	if(three == true) {
		System.out.println("3");
	}else if(count > max) {
		System.out.println(count);
	}else {
		System.out.println(max);
	}

}
} Main
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
	Scanner sc = new Scanner (System.in);
	ArrayList<String> slist = new ArrayList<>();

	String s = sc.next();
	boolean three = false;
	int count = 0;
	int max = 0;

	if(s.equals("RRR")) {
		max = 3;
	}else {
		for(int i = 0; i < 3; i++) {
			slist.add(s.substring(i, i+1));
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				three = true;
			}else {
				three = false;
				break;
			}
		}

		for(int i = 0; i < 3; i++) {
			if(slist.get(i).equals("R")) {
				count++;
			}else if(slist.get(i).equals("S")) {
				if(max < count) {
					max = count;
					count = 0;
				}
			}
		}
	}
	if(three == true) {
		System.out.println("3");
	}else if(count > max) {
		System.out.println(count);
	}else {
		System.out.println(max);
	}

}
}
