import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s3 = sc.next();
        String[] split = s3.split("");
        int rain=0;
        int a=0;
        for(int i=0; i<3; i++) {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        }
        System.out.println(rain);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s3 = sc.next();
        String[] split = s3.split("");
        int rain=0;
        int a=0;
        for(int i=0; i<3; i++) {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        }
        System.out.println(rain);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s3 = sc.next();
        String[] split = s3.split("");
        int rain=0;
        int a=0;
        for(int i=0; i<3; i++) {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        }
        System.out.println(rain);
    } main {
        Scanner sc = new Scanner(System.in);
        String s3 = sc.next();
        String[] split = s3.split("");
        int rain=0;
        int a=0;
        for(int i=0; i<3; i++) {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        }
        System.out.println(rain);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s3 = sc.next(); s3 sc.next() sc.next sc String[] split = s3.split(""); split s3.split("") s3.split s3 "" int rain=0; rain 0 int a=0; a 0 for(int i=0; i<3; i++) {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        } {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        } if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            } split[i].equals("R") split[i].equals split[i] split i "R" {
                rain += 1;
            } rain += 1 rain 1 if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            } split[i].equals("S") split[i].equals split[i] split i "S" {
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            } if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                } rain == 2||rain == 1 rain == 2 rain 2 rain == 1 rain 1 {
                    break;
                } break; {
                    rain = 0;
                } rain = 0 rain 0 System.out.println(rain) System.out.println System.out System System.out rain String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s3 = sc.next();
        String[] split = s3.split("");
        int rain=0;
        int a=0;
        for(int i=0; i<3; i++) {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        }
        System.out.println(rain);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s3 = sc.next();
        String[] split = s3.split("");
        int rain=0;
        int a=0;
        for(int i=0; i<3; i++) {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        }
        System.out.println(rain);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s3 = sc.next();
        String[] split = s3.split("");
        int rain=0;
        int a=0;
        for(int i=0; i<3; i++) {
            if(split[i].equals("R")) {
                rain += 1;
            }else if(split[i].equals("S")){
                if(rain == 2||rain == 1) {
                    break;
                }else {
                    rain = 0;
                }
            }
        }
        System.out.println(rain);
    }
}