import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		int ans = 0;

		switch(S) {
		case "SSS":
			ans = 0;
			break;
		case "SSR":
			ans = 1;
			break;
		case "SRS":
			ans = 1;
			break;
		case "SRR":
			ans = 2;
			break;
		case "RSS":
			ans = 1;
			break;
		case "RSR":
			ans = 1;
			break;
		case "RRS":
			ans = 2;
			break;
		case "RRR":
			ans = 3;
			break;
		}
		System.out.println(ans);

	}
} import java.io.FileNotFoundException; FileNotFoundException java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		int ans = 0;

		switch(S) {
		case "SSS":
			ans = 0;
			break;
		case "SSR":
			ans = 1;
			break;
		case "SRS":
			ans = 1;
			break;
		case "SRR":
			ans = 2;
			break;
		case "RSS":
			ans = 1;
			break;
		case "RSR":
			ans = 1;
			break;
		case "RRS":
			ans = 2;
			break;
		case "RRR":
			ans = 3;
			break;
		}
		System.out.println(ans);

	}
} Main public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		int ans = 0;

		switch(S) {
		case "SSS":
			ans = 0;
			break;
		case "SSR":
			ans = 1;
			break;
		case "SRS":
			ans = 1;
			break;
		case "SRR":
			ans = 2;
			break;
		case "RSS":
			ans = 1;
			break;
		case "RSR":
			ans = 1;
			break;
		case "RRS":
			ans = 2;
			break;
		case "RRR":
			ans = 3;
			break;
		}
		System.out.println(ans);

	} main {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		int ans = 0;

		switch(S) {
		case "SSS":
			ans = 0;
			break;
		case "SSR":
			ans = 1;
			break;
		case "SRS":
			ans = 1;
			break;
		case "SRR":
			ans = 2;
			break;
		case "RSS":
			ans = 1;
			break;
		case "RSR":
			ans = 1;
			break;
		case "RRS":
			ans = 2;
			break;
		case "RRR":
			ans = 3;
			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 "SSS":
			ans = 0;
			break;
		case "SSR":
			ans = 1;
			break;
		case "SRS":
			ans = 1;
			break;
		case "SRR":
			ans = 2;
			break;
		case "RSS":
			ans = 1;
			break;
		case "RSR":
			ans = 1;
			break;
		case "RRS":
			ans = 2;
			break;
		case "RRR":
			ans = 3;
			break;
		} S case "SSS": "SSS" case "SSS": ans = 0 ans 0 break; case "SSR": "SSR" case "SSR": ans = 1 ans 1 break; case "SRS": "SRS" case "SRS": ans = 1 ans 1 break; case "SRR": "SRR" case "SRR": ans = 2 ans 2 break; case "RSS": "RSS" case "RSS": ans = 1 ans 1 break; case "RSR": "RSR" case "RSR": ans = 1 ans 1 break; case "RRS": "RRS" case "RRS": ans = 2 ans 2 break; case "RRR": "RRR" case "RRR": ans = 3 ans 3 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) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		int ans = 0;

		switch(S) {
		case "SSS":
			ans = 0;
			break;
		case "SSR":
			ans = 1;
			break;
		case "SRS":
			ans = 1;
			break;
		case "SRR":
			ans = 2;
			break;
		case "RSS":
			ans = 1;
			break;
		case "RSR":
			ans = 1;
			break;
		case "RRS":
			ans = 2;
			break;
		case "RRR":
			ans = 3;
			break;
		}
		System.out.println(ans);

	}
} public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		int ans = 0;

		switch(S) {
		case "SSS":
			ans = 0;
			break;
		case "SSR":
			ans = 1;
			break;
		case "SRS":
			ans = 1;
			break;
		case "SRR":
			ans = 2;
			break;
		case "RSS":
			ans = 1;
			break;
		case "RSR":
			ans = 1;
			break;
		case "RRS":
			ans = 2;
			break;
		case "RRR":
			ans = 3;
			break;
		}
		System.out.println(ans);

	}
} Main
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		int ans = 0;

		switch(S) {
		case "SSS":
			ans = 0;
			break;
		case "SSR":
			ans = 1;
			break;
		case "SRS":
			ans = 1;
			break;
		case "SRR":
			ans = 2;
			break;
		case "RSS":
			ans = 1;
			break;
		case "RSR":
			ans = 1;
			break;
		case "RRS":
			ans = 2;
			break;
		case "RRR":
			ans = 3;
			break;
		}
		System.out.println(ans);

	}
}
