import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] ar = str.split("");
        int c = 0;
        String r = "R";
        if (ar[0].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[1].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[2].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (c == 1 || c == 3 || c == 0) {
            System.out.println(c);
        } else if ( c == 2 && ar[0].equals(r) && ar[2].equals(r)) {
            System.out.println(1);
        } else {
            System.out.println(2);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] ar = str.split("");
        int c = 0;
        String r = "R";
        if (ar[0].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[1].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[2].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (c == 1 || c == 3 || c == 0) {
            System.out.println(c);
        } else if ( c == 2 && ar[0].equals(r) && ar[2].equals(r)) {
            System.out.println(1);
        } else {
            System.out.println(2);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] ar = str.split("");
        int c = 0;
        String r = "R";
        if (ar[0].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[1].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[2].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (c == 1 || c == 3 || c == 0) {
            System.out.println(c);
        } else if ( c == 2 && ar[0].equals(r) && ar[2].equals(r)) {
            System.out.println(1);
        } else {
            System.out.println(2);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] ar = str.split("");
        int c = 0;
        String r = "R";
        if (ar[0].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[1].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[2].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (c == 1 || c == 3 || c == 0) {
            System.out.println(c);
        } else if ( c == 2 && ar[0].equals(r) && ar[2].equals(r)) {
            System.out.println(1);
        } else {
            System.out.println(2);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc String[] ar = str.split(""); ar str.split("") str.split str "" int c = 0; c 0 String r = "R"; r "R" if (ar[0].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        } ar[0].equals(r) ar[0].equals ar[0] ar 0 r {
            c = c + 1;
        } c = c + 1 c c + 1 c 1 {
            c = c;
        } c = c c c if (ar[1].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        } ar[1].equals(r) ar[1].equals ar[1] ar 1 r {
            c = c + 1;
        } c = c + 1 c c + 1 c 1 {
            c = c;
        } c = c c c if (ar[2].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        } ar[2].equals(r) ar[2].equals ar[2] ar 2 r {
            c = c + 1;
        } c = c + 1 c c + 1 c 1 {
            c = c;
        } c = c c c if (c == 1 || c == 3 || c == 0) {
            System.out.println(c);
        } else if ( c == 2 && ar[0].equals(r) && ar[2].equals(r)) {
            System.out.println(1);
        } else {
            System.out.println(2);
        } c == 1 || c == 3 || c == 0 c == 1 || c == 3 || c == 0 c == 1 c 1 c == 3 c 3 c == 0 c 0 {
            System.out.println(c);
        } System.out.println(c) System.out.println System.out System System.out c if ( c == 2 && ar[0].equals(r) && ar[2].equals(r)) {
            System.out.println(1);
        } else {
            System.out.println(2);
        } c == 2 && ar[0].equals(r) && ar[2].equals(r) c == 2 && ar[0].equals(r) && ar[2].equals(r) c == 2 c 2 ar[0].equals(r) ar[0].equals ar[0] ar 0 r ar[2].equals(r) ar[2].equals ar[2] ar 2 r {
            System.out.println(1);
        } System.out.println(1) System.out.println System.out System System.out 1 {
            System.out.println(2);
        } System.out.println(2) System.out.println System.out System System.out 2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] ar = str.split("");
        int c = 0;
        String r = "R";
        if (ar[0].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[1].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[2].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (c == 1 || c == 3 || c == 0) {
            System.out.println(c);
        } else if ( c == 2 && ar[0].equals(r) && ar[2].equals(r)) {
            System.out.println(1);
        } else {
            System.out.println(2);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] ar = str.split("");
        int c = 0;
        String r = "R";
        if (ar[0].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[1].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[2].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (c == 1 || c == 3 || c == 0) {
            System.out.println(c);
        } else if ( c == 2 && ar[0].equals(r) && ar[2].equals(r)) {
            System.out.println(1);
        } else {
            System.out.println(2);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String[] ar = str.split("");
        int c = 0;
        String r = "R";
        if (ar[0].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[1].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (ar[2].equals(r)) {
            c = c + 1;
        } else {
            c = c;
        }
        if (c == 1 || c == 3 || c == 0) {
            System.out.println(c);
        } else if ( c == 2 && ar[0].equals(r) && ar[2].equals(r)) {
            System.out.println(1);
        } else {
            System.out.println(2);
        }
    }
}