import java.util.*;

public class Main {
	public static void main(String[] args){
 
        Scanner sc = null;
        sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        String before = "";
        int ans = 0;

        for (int i = 0; i < 3; i++) {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        }

        System.out.println(ans);   
      }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
 
        Scanner sc = null;
        sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        String before = "";
        int ans = 0;

        for (int i = 0; i < 3; i++) {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        }

        System.out.println(ans);   
      }
} Main public static void main(String[] args){
 
        Scanner sc = null;
        sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        String before = "";
        int ans = 0;

        for (int i = 0; i < 3; i++) {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        }

        System.out.println(ans);   
      } main {
 
        Scanner sc = null;
        sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        String before = "";
        int ans = 0;

        for (int i = 0; i < 3; i++) {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        }

        System.out.println(ans);   
      } Scanner sc = null; sc null sc = new Scanner(System.in) sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc sc.close() sc.close sc String before = ""; before "" int ans = 0; ans 0 for (int i = 0; i < 3; i++) {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        } {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        } if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            } i == 0 i 0 {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } if(s.substring(0,1).equals("R")){
                    ans = 1;
                } s.substring(0,1).equals("R") s.substring(0,1).equals s.substring(0,1) s.substring s 0 1 "R" {
                    ans = 1;
                } ans = 1 ans 1 before = s.substring(0,1) before s.substring(0,1) s.substring s 0 1 {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            } if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                } s.substring(i, i + 1).equals("R") && before.equals("R") s.substring(i, i + 1).equals("R") s.substring(i, i + 1).equals s.substring(i, i + 1) s.substring s i i + 1 i 1 "R" before.equals("R") before.equals before "R" {
                    ans += 1;
                } ans += 1 ans 1 if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                } s.substring(i, i + 1).equals("R") && before.equals("S") s.substring(i, i + 1).equals("R") s.substring(i, i + 1).equals s.substring(i, i + 1) s.substring s i i + 1 i 1 "R" before.equals("S") before.equals before "S" {
                    ans = 1;
                } ans = 1 ans 1 before = s.substring(i, i + 1) before s.substring(i, i + 1) s.substring s i i + 1 i 1 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 = null;
        sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        String before = "";
        int ans = 0;

        for (int i = 0; i < 3; i++) {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        }

        System.out.println(ans);   
      }
} public class Main {
	public static void main(String[] args){
 
        Scanner sc = null;
        sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        String before = "";
        int ans = 0;

        for (int i = 0; i < 3; i++) {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        }

        System.out.println(ans);   
      }
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
 
        Scanner sc = null;
        sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        String before = "";
        int ans = 0;

        for (int i = 0; i < 3; i++) {
            if (i == 0) {
                if(s.substring(0,1).equals("R")){
                    ans = 1;
                }
                before = s.substring(0,1);
            } else {
                if (s.substring(i, i + 1).equals("R") && before.equals("R")) {
                    ans += 1;
                }else if(s.substring(i, i + 1).equals("R") && before.equals("S")){
                    ans = 1;
                }
                before = s.substring(i, i + 1);
            }
        }

        System.out.println(ans);   
      }
}