import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = 0;
		switch (s){
			case "RRR":
				ans = 3;
				break;
			case "RRS":
				ans = 2;
				break;
			case "SRR":
				ans = 2;
				break;
			case "RSR":
				ans = 1;
				break;
			case "SSR":
				ans = 1;
				break;
			case "SRS":
				ans = 1;
				break;
			case "RSS":
				ans = 1;
				break;
			case "SSS":
				ans = 0;
				break;
		}
		System.out.println(ans);
	}
} 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();
		int ans = 0;
		switch (s){
			case "RRR":
				ans = 3;
				break;
			case "RRS":
				ans = 2;
				break;
			case "SRR":
				ans = 2;
				break;
			case "RSR":
				ans = 1;
				break;
			case "SSR":
				ans = 1;
				break;
			case "SRS":
				ans = 1;
				break;
			case "RSS":
				ans = 1;
				break;
			case "SSS":
				ans = 0;
				break;
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = 0;
		switch (s){
			case "RRR":
				ans = 3;
				break;
			case "RRS":
				ans = 2;
				break;
			case "SRR":
				ans = 2;
				break;
			case "RSR":
				ans = 1;
				break;
			case "SSR":
				ans = 1;
				break;
			case "SRS":
				ans = 1;
				break;
			case "RSS":
				ans = 1;
				break;
			case "SSS":
				ans = 0;
				break;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = 0;
		switch (s){
			case "RRR":
				ans = 3;
				break;
			case "RRS":
				ans = 2;
				break;
			case "SRR":
				ans = 2;
				break;
			case "RSR":
				ans = 1;
				break;
			case "SSR":
				ans = 1;
				break;
			case "SRS":
				ans = 1;
				break;
			case "RSS":
				ans = 1;
				break;
			case "SSS":
				ans = 0;
				break;
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int ans = 0; ans 0 switch (s){
			case "RRR":
				ans = 3;
				break;
			case "RRS":
				ans = 2;
				break;
			case "SRR":
				ans = 2;
				break;
			case "RSR":
				ans = 1;
				break;
			case "SSR":
				ans = 1;
				break;
			case "SRS":
				ans = 1;
				break;
			case "RSS":
				ans = 1;
				break;
			case "SSS":
				ans = 0;
				break;
		} s case "RRR": "RRR" case "RRR": ans = 3 ans 3 break; case "RRS": "RRS" case "RRS": ans = 2 ans 2 break; case "SRR": "SRR" case "SRR": ans = 2 ans 2 break; case "RSR": "RSR" case "RSR": ans = 1 ans 1 break; case "SSR": "SSR" case "SSR": ans = 1 ans 1 break; case "SRS": "SRS" case "SRS": ans = 1 ans 1 break; case "RSS": "RSS" case "RSS": ans = 1 ans 1 break; case "SSS": "SSS" case "SSS": ans = 0 ans 0 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = 0;
		switch (s){
			case "RRR":
				ans = 3;
				break;
			case "RRS":
				ans = 2;
				break;
			case "SRR":
				ans = 2;
				break;
			case "RSR":
				ans = 1;
				break;
			case "SSR":
				ans = 1;
				break;
			case "SRS":
				ans = 1;
				break;
			case "RSS":
				ans = 1;
				break;
			case "SSS":
				ans = 0;
				break;
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = 0;
		switch (s){
			case "RRR":
				ans = 3;
				break;
			case "RRS":
				ans = 2;
				break;
			case "SRR":
				ans = 2;
				break;
			case "RSR":
				ans = 1;
				break;
			case "SSR":
				ans = 1;
				break;
			case "SRS":
				ans = 1;
				break;
			case "RSS":
				ans = 1;
				break;
			case "SSS":
				ans = 0;
				break;
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = 0;
		switch (s){
			case "RRR":
				ans = 3;
				break;
			case "RRS":
				ans = 2;
				break;
			case "SRR":
				ans = 2;
				break;
			case "RSR":
				ans = 1;
				break;
			case "SSR":
				ans = 1;
				break;
			case "SRS":
				ans = 1;
				break;
			case "RSS":
				ans = 1;
				break;
			case "SSS":
				ans = 0;
				break;
		}
		System.out.println(ans);
	}
}