import java.util.*;
public class Main {



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int k=0;
		if(s.equals("RRR")) {
			k=3;
		}else if(s.equals("RRS")||s.equals("SRR"))  {
			k=2;
		}else if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		}
		System.out.println(k);

	}

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



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int k=0;
		if(s.equals("RRR")) {
			k=3;
		}else if(s.equals("RRS")||s.equals("SRR"))  {
			k=2;
		}else if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		}
		System.out.println(k);

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int k=0;
		if(s.equals("RRR")) {
			k=3;
		}else if(s.equals("RRS")||s.equals("SRR"))  {
			k=2;
		}else if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		}
		System.out.println(k);

	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int k=0;
		if(s.equals("RRR")) {
			k=3;
		}else if(s.equals("RRS")||s.equals("SRR"))  {
			k=2;
		}else if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		}
		System.out.println(k);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int k=0; k 0 if(s.equals("RRR")) {
			k=3;
		}else if(s.equals("RRS")||s.equals("SRR"))  {
			k=2;
		}else if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		} s.equals("RRR") s.equals s "RRR" {
			k=3;
		} k=3 k 3 if(s.equals("RRS")||s.equals("SRR"))  {
			k=2;
		}else if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		} s.equals("RRS")||s.equals("SRR") s.equals("RRS") s.equals s "RRS" s.equals("SRR") s.equals s "SRR" {
			k=2;
		} k=2 k 2 if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		} s.equals("SSS") s.equals s "SSS" {
			k=0;
		} k=0 k 0 {
			k=1;
		} k=1 k 1 System.out.println(k) System.out.println System.out System System.out k String[] args args public class Main {



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int k=0;
		if(s.equals("RRR")) {
			k=3;
		}else if(s.equals("RRS")||s.equals("SRR"))  {
			k=2;
		}else if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		}
		System.out.println(k);

	}

} public class Main {



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int k=0;
		if(s.equals("RRR")) {
			k=3;
		}else if(s.equals("RRS")||s.equals("SRR"))  {
			k=2;
		}else if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		}
		System.out.println(k);

	}

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



	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int k=0;
		if(s.equals("RRR")) {
			k=3;
		}else if(s.equals("RRS")||s.equals("SRR"))  {
			k=2;
		}else if(s.equals("SSS"))  {
			k=0;
		}else {
			k=1;
		}
		System.out.println(k);

	}

}
